Added bs-css, styld Chart.re

This commit is contained in:
Ozzie Gooen 2020-02-13 18:35:10 +00:00
parent b85f2c8729
commit dfbdc51085
5 changed files with 31 additions and 12 deletions

View File

@ -19,6 +19,7 @@
"bs-ant-design-alt",
"reason-react",
"bs-reform",
"bs-css",
"rationale",
"bs-moment",
"reschema"

View File

@ -28,6 +28,7 @@
"antd": "3.17.0",
"autoprefixer": "^9.7.4",
"bs-ant-design-alt": "2.0.0-alpha.31",
"bs-css": "^11.0.0",
"bs-moment": "0.4.4",
"bs-reform": "9.7.1",
"lenses-ppx": "4.0.0",

View File

@ -1,3 +1,15 @@
module Styles = {
open Css;
let graph = chartColor =>
style([
selector(".axis", [fontSize(`px(9))]),
selector(".domain", [display(`none)]),
selector(".tick line", [display(`none)]),
selector(".tick text", [color(`hex("bfcad4"))]),
selector(".chart .area-path", [SVG.fill(chartColor)]),
]);
};
[@react.component]
let make =
(
@ -8,13 +20,15 @@ let make =
~height=50,
~color=`hex("7e9db7"),
) =>
<ForetoldComponents.CdfChart__Base
width=0
height
?minX
?maxX
marginBottom=20
showVerticalLine=false
showDistributionLines=false
primaryDistribution=data
/>;
<div className={Styles.graph(color)}>
<ForetoldComponents.CdfChart__Base
width=0
height
?minX
?maxX
marginBottom=20
showVerticalLine=false
showDistributionLines=false
primaryDistribution=data
/>
</div>;

View File

@ -40,7 +40,10 @@ module Value = {
let cdf: Types.distribution =
CdfLibrary.Distribution.fromString(r, 2000);
<>
<Chart data={cdf |> CdfLibrary.Distribution.toPdf |> Types.toJs} />
<Chart
height=100
data={cdf |> CdfLibrary.Distribution.toPdf |> Types.toJs}
/>
{r |> ReasonReact.string}
</>;
| Probability(r) =>

View File

@ -1955,7 +1955,7 @@ bs-ant-design-alt@2.0.0-alpha.31:
bs-moment "^0.4.4"
re-classnames "^4.0.0"
bs-css@11.0.0:
bs-css@11.0.0, bs-css@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/bs-css/-/bs-css-11.0.0.tgz#6ed1726d7c06aa584d255d1cf23240a2acc0aa07"
integrity sha512-bpSwj1VvmWNMoJ5qnsHMQC+Mj0zjL9iwcOhl5ipP7Hfr7v+ZyKqjSMaMK+L1EdukuCp0rJmRD2I/MbS4BHnMmQ==