Created
September 18, 2017 02:14
-
-
Save andredublin/d2df0826ed187eb2639a4d5662c31279 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FableD3 | |
open Fable.Core | |
open Fable.Core.JsInterop | |
open Fable.Import | |
open Fable.Import.Browser | |
let chart() = | |
let data = [| 30; 86; 168; 201; 303; 365 |] | |
D3.Globals.select("chart") | |
.selectAll("div") | |
.data(data) | |
|> fun x -> (unbox<D3.Selection.Update<int>> x).enter() | |
|> fun x -> x.append("div") | |
|> fun x -> (unbox<D3.Selection.Update<HTMLDivElementType>> x).style("width", fun _ b _ -> U3.Case2(b.ToString() + "px")) | |
|> fun x -> (unbox<D3.Selection.Update<HTMLDivElementType>> x).text() | |
chart() |> ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR in ./src/App.fs | |
Module not found: Error: Can't resolve 'd3' in 'D:\FableD3\src' | |
@ ./src/App.fs 2:0-25 | |
@ ./src/FableD3.fsproj | |
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/FableD3.fsproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netstandard2.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<Compile Include="..\paket-files\fable-compiler\fable-graphics\bindings\fable-import-d3\Fable.Import.D3.fs"> | |
<Paket>True</Paket> | |
<Link>paket-files/Fable.Import.D3.fs</Link> | |
</Compile> | |
<Compile Include="App.fs" /> | |
</ItemGroup> | |
<Import Project="..\.paket\Paket.Restore.targets" /> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment