{"id":18822930,"url":"https://github.com/adaptiveconsulting/reactgraph","last_synced_at":"2025-04-14T01:24:46.858Z","repository":{"id":19116798,"uuid":"22345805","full_name":"AdaptiveConsulting/ReactGraph","owner":"AdaptiveConsulting","description":"ReactGraph is a library to make change propagation easy in .NET. ","archived":false,"fork":false,"pushed_at":"2014-12-09T11:34:56.000Z","size":2785,"stargazers_count":63,"open_issues_count":7,"forks_count":20,"subscribers_count":120,"default_branch":"master","last_synced_at":"2025-04-13T07:20:43.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdaptiveConsulting.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-28T14:37:27.000Z","updated_at":"2024-09-03T04:40:18.000Z","dependencies_parsed_at":"2022-07-23T02:16:26.613Z","dependency_job_id":null,"html_url":"https://github.com/AdaptiveConsulting/ReactGraph","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FReactGraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FReactGraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FReactGraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FReactGraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdaptiveConsulting","download_url":"https://codeload.github.com/AdaptiveConsulting/ReactGraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248805779,"owners_count":21164387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T00:52:08.507Z","updated_at":"2025-04-14T01:24:46.822Z","avatar_url":"https://github.com/AdaptiveConsulting.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](resources/package_icon_small.png) ReactGraph\r\n==========\r\n\r\nReactGraph is a library to make change propagation easy in .NET. It allows you to define formulas targeting properties and when any value used in that formula is changed it will be re-evaluated.\r\n\r\nWhat makes ReactGraph useful is that it does not blindly react to changes, when any property changes it will perform a breadth-first topological sort to ensure each property is only recalculated once.\r\n\r\nIt is basically *excel formulas* in .net, except better.\r\n\r\nReactGraph was built because of pain building complex forms with many fields calculating defaults based on other fields changing common in larger line of business applications. This library has not been used in production yet and we are putting it out there to see if people like the idea/implementation. \r\n\r\nFeedback welcome!\r\n\r\n## A simple example - mortgage calculator\r\nOur sample app includes a mortgage calculator which allows you to edit both payment amount and the loan length. Doing this can be problematic normally because it is cyclic in nature, because ReactGraph understands this it can break it apart.\r\n\r\nThis is our UI we want to make work  \r\n![README](resources/README.png)\r\n\r\nThen we simply declare our formulas. \r\n\r\n\tvar mortgageEngine = new DependencyEngine();\r\n\tmortgageEngine\r\n\t    .Assign(() =\u003e Mortgage.Payments)\r\n\t    .From(() =\u003e MortgageCalculations.CalculatePayments(\r\n\t            Mortgage.Amount,\r\n\t            Mortgage.InterestRate,\r\n\t            Mortgage.LoanLength,\r\n\t            Mortgage.PaymentFrequency),\r\n\t            ex =\u003e { });\r\n\t\r\n\tmortgageEngine\r\n\t    .Assign(() =\u003e Mortgage.LoanLength)\r\n\t    .From(() =\u003e MortgageCalculations.CalculateLength(\r\n\t            Mortgage.Amount,\r\n\t            Mortgage.Payments,\r\n\t            Mortgage.InterestRate,\r\n\t            Mortgage.PaymentFrequency),\r\n\t            ex =\u003e { });\r\n\r\nIf I change the payment amount then I see the impact on the length of the loan  \r\n![README1](resources/README1.png)\r\n\r\nWe can then visualise the dependencies between the different fields and how they are related (using the ReactGraph.Visualisation library `.ToDotFormat()` extension method):  \r\n![README3](resources/README3.png)\r\n\r\nWe can also turn off formulas so we can just see the dependencies between fields with the following code:  \r\n\r\n    mortgageEngine.ToDotFormat(options: new VisualisationOptions\r\n            {\r\n                ShowFormulas = false,\r\n                ShowRoot = false\r\n            });\r\n            \r\n![README4](resources/README4.png)\r\n\r\n## GraphViz Online Viewers\r\nCurrently ReactGraph just outputs graphs in [DOT](http://en.wikipedia.org/wiki/DOT_(graph_description_language)) format. You need to use an online viewer to then visualise the graph. \r\n\r\n[http://graphviz-dev.appspot.com/](http://graphviz-dev.appspot.com/)  \r\n[http://stamm-wilbrandt.de/GraphvizFiddle/](http://stamm-wilbrandt.de/GraphvizFiddle/)  \r\n[http://sandbox.kidstrythisathome.com/erdos/](http://sandbox.kidstrythisathome.com/erdos/)\r\n\r\n## Other resources\r\n[http://weareadaptive.com/blog/2014/11/16/released-reactgraph-library/](Introduction Blog Post)\r\n\r\n### Icon\r\nNetwork by Murali Krishna from The Noun Project\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptiveconsulting%2Freactgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadaptiveconsulting%2Freactgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptiveconsulting%2Freactgraph/lists"}