You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importchartDatafrom'./user_sample.json!';importReactfrom'react';importReactDOMfrom'react-dom';import{LineChart}from'react-d3-basic';// loading chart data from json file using json-pluginimportchartDatafrom'./user_sample.json!';constwidth=700;constheight=300;constmargins={left: 100,right: 100,top: 50,bottom: 50};consttitle='User sample';// chart series,// field: is what field your data want to be selected// name: the name of the field that display in legend// color: what color is the lineconstchartSeries=[{field: 'BMI',name: 'BMI',color: '#ff7f0e'}];// your x accessorconstx=(d)=>d.index;// Leaving out the Chart from the regular getting started because it didn't // nest the LineChart inside it properly and it didn't seem to be necessary. ReactDOM.render(<LineChartmargins={margins}title={title}data={chartData}width={width}height={height}chartSeries={chartSeries}x={x}/>,document.getElementById('chart'));
Now you can serve the folder in a web server and visit this index.html in a browser.
You can also easily create a useful npm start with a webserver and hot reloading by:
Hi folks I wanted to share how you can go through your getting started using JSPM. Benefits include no manual config file and es6 out of the box.
Use the same data source.
Installation of jspm & dependencies:
HTML file:
index.html
Javascript file:
main.js
Now you can serve the folder in a web server and visit this index.html in a browser.
You can also easily create a useful
npm start
with a webserver and hot reloading by:Alter
index.html
Add npm script:
Now you can run
npm start
and visitlocalhost:3000
The text was updated successfully, but these errors were encountered: