adaptiveconsulting / reactgraph Goto Github PK
View Code? Open in Web Editor NEWReactGraph is a library to make change propagation easy in .NET.
License: Apache License 2.0
ReactGraph is a library to make change propagation easy in .NET.
License: Apache License 2.0
void Main()
{
var engine = new DependencyEngine();
engine.Assign(() => C).From(() => A + B, e => { });
engine.Assign(() => D).From(() => A + C, e => { });
engine.ToDotFormat(options: new VisualisationOptions { ShowRoot = false }).Dump();
}
public int A { get; set; }
public int B { get; set; }
public int C { get; set; }
public int D { get; set; }
Results in:
digraph {
__1 [label="(A + B)", fillcolor="lightblue", style="filled", shape="octagon"];
__5 [label="(A + C)", fillcolor="lightblue", style="filled", shape="octagon"];
}
Expected:
digraph {
__1 [label="(A + B)", fillcolor="lightblue", style="filled", shape="octagon"];
__2 [label="C", shape="box", style="filled,rounded"];
__5 [label="(A + C)", fillcolor="lightblue", style="filled", shape="octagon"];
__3 [label="A", shape="box", style="filled,rounded"];
__4 [label="B", shape="box", style="filled,rounded"];
__6 [label="D", shape="box", style="filled,rounded"];
__1 -> __2;
__2 -> __5;
__5 -> __6;
__3 -> __1;
__3 -> __5;
__4 -> __1;
}
Can get this result by setting ShowRoot to true
at the moment if you use A.B as a parameter in an expression, A must be writable. Should not have to be like that. Also the error you get is very obscure.
See following article for possible algo: http://en.wikipedia.org/wiki/Tarjan%E2%80%99s_strongly_connected_components_algorithm
Evaluate simple expressions and set target property
When an expression uses a static method (for instance: () => SomeStaticMethod(foo.A, bar.B)), the text representation in the graph is wrong (it prints foo.A.SomeStaticMethod(bar.B))
When a condition is applied it is run before considering that binding. If condition is false then it should not continue down that path.
Both the scenario of calling Bind twice, but also two separate expressions targeting the same property
engine.Assign(() => foo.BarBoolean)
.From( barBool => ...);
We probably need a way to release an instance from the library so they stop being tracked and are removed from the graph
I used this class in Shouldly to clean up expressions so I pulled it out into a new project.
engine.Assign(() => C).From(() => Add(A, B), e => { });
will not trigger when A or B are changed
Should suspend walking through the dependency graph and then resume (continuation)
For example
engine.Exp(() => vm.CanFoo).Action(()=>vm.FooCommand.RaiseCanExecuteChanged());
instead of
a -> a + b -> c
b ->
do
a -> c
b ->
I'm not sure yet if we need that for everything, or per expression...
graphOptionsEngine
.Assign(() => MortgageGraph)
.From(() => CreateMortgageGraph(ShowRoots, ShowFormulas), ex => { })
.TriggerNow();
Not sure about the name of the API, but should be able to trigger the formula right away.
If there are more than say 3 it should do MethodCall(Arg1, ..., Arg5)
We can see the nodes in the graph which feed in anyways
Being able to attach to nested properties:
A.B.C
Here http://adaptivebuild.cloudapp.net/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.