dotnet-websharper / d3 Goto Github PK
View Code? Open in Web Editor NEWWebSharper bindings for D3 (http://d3js.org)
License: Apache License 2.0
WebSharper bindings for D3 (http://d3js.org)
License: Apache License 2.0
Currently - unit.
from here:
http://www.websharper.com/extensions/d3
D3.SelectAll("p").Data([|4; 8; 15; 16; 23; 42|]).Style("font-size", fun (d, _) -> string d + "px") |> ignore
Generates these errors!
Error 3 Possible overload: 'Selection.Data(values: obj []) : UpdateSelection'. Type constraint mismatch. The type
int []
is not compatible with type
obj []
The type 'obj' does not match the type 'int'. c:\projects\websharper\exp\Client.fs 56 9 exp
Error 5 Possible overload: 'Selection.Data(values: obj * int -> obj []) : UpdateSelection'. Type constraint mismatch. The type
int []
is not compatible with type
obj * int -> obj []
The type 'int []' is not compatible with the type 'obj * int -> obj []'. c:\projects\websharper\exp\Client.fs 56 9 exp
Error 4 Possible overload: 'Selection.Data(values: Core.Functions.Func<Dom.Element,obj,int,obj []>) : UpdateSelection'. Type constraint mismatch. The type
int []
is not compatible with type
Core.Functions.Func<Dom.Element,obj,int,obj []>
The type 'int []' is not compatible with the type 'Core.Functions.Func<Dom.Element,obj,int,obj []>'. c:\projects\websharper\exp\Client.fs 56 9 exp
Error 2 No overloads match for method 'Data'. The available overloads are shown below (or in the Error List window). c:\projects\websharper\exp\Client.fs 56 9 exp
Transitions also allow delays to be specified on sub-transitions, using a function which takes an object and its index, much like with Attr:
transition.SelectAll(".bar")
.Attr("x",
(fun (o, i) ->
let d = o :?> LetterData
x0.Apply(d.Letter)))
See https://github.com/mbostock/d3/wiki/Transitions:
# transition.delay([delay])
Specifies the transition delay in milliseconds. If delay is a constant, then all elements are given the same delay; otherwise, if delay is a function, then the function is evaluated for each selected element (in order), being passed the current datum d and the current index i, with the this context as the current DOM element. The function's return value is then used to set each element's delay. The default delay is 0. If delay is not specified, returns the delay bound to the first non-null element in the transition.
Setting the delay to be a multiple of the index i is a convenient way to stagger transitions for elements. For example, if you used a fixed duration of duration, and have n elements in the current selection, you can stagger the transition over 2 * duration by saying:
.delay(function(d, i) { return i / n * duration; })
You may also compute the delay as a function of the data, thereby creating a data-driven animation.
While a delay may be specified for the entire transition, this function overload doesn't seem to exist.
Should it accept 'T[]? Currently non-idiomatic usage such as sel.Data(As<obj[]> nodes)
.
For propagating built site to gh-pages.
I am using something like this:
type Force with
[<Inline "$0.nodes($1)">]
member f.Nodes(xs: array<ForceNode>) = f
Not typeable with current binding.
See for ex. here:
https://github.com/intellifactory/websharper.samples.freebaseviz/blob/master/FreeBaseViz/Viz.fs#L12
Would be nice not to have to write these shims.
Need a binding here, see:
https://github.com/mbostock/d3/wiki/Force-Layout#size
The "foo.raw" methods are not accepted by the WIG backend, for now I am commenting them out. Looking at latest D3 docs, I am not sure those methods are even present.
Need to review how this is used and how to properly bind it.
And has the wrong return type, should return Force.
Hi guys,
Are there any plans to:
Duplicate type with name 'IntelliFactory.WebSharper.D3.Polygon' in assembly 'IntelliFactory.WebSharper.D3, Version=2.5.0.0, Culture=neutral, PublicKeyToken=dcd983dec8f76a71'.
Here is a list of issues revealed by PEVerify:
"foo.raw" => X
are brokenCurrently this does not work as in the samples. I have been using this workaround:
type Force with
[<Inline "$1.call($0.drag)">]
member f.EnableDrag(sel: Selection) = f.Drag
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.