Closed risenW closed 3 years ago
Views on the Frictionless object are rendered on the page ...
datapackage-views-js
How it works
Frictionless Data View (https://specs.frictionlessdata.io/views/) in a Data Package. E.g. this is a simple one:
{ "id": "Graph", "type": "Graph", "state": { "graphType": "lines", "group": "Date", "series": [ "VIXClose" ] } }
Convert the view to spec for the charting library.
_values
graph LR view --> compiled[Compiled View] compiled --datapackage-render-js--> plotly[Plotly Spec] compiled --> vega[Vega Spec]
Algorithm for inlining the data ... - see https://github.com/datopian/frontend-showcase-js/blob/d8918ef6172d394e4bacff4fb8acbd4102fa0ebf/src/index.jsx#L67-L85
resources
How it starts
Then becomes
{ // where the data comes from ... "resources": [0], "id": "Graph", "type": "Graph", "state": { "graphType": "lines", "group": "Date", "series": [ "VIXClose" ] } }
Then becomes ...
{ // where the data comes from ... "resources": [ { name: ... _values: ... } ], "id": "Graph", "type": "Graph", "state": { "graphType": "lines", "group": "Date", "series": [ "VIXClose" ] } }
https://github.com/datopian/datapackage-views-js/blob/bb08d2032e/__fixtures__/chart.fixtures.js
Given a Frictionless Dataset with a Frictionless View like ...
Use the library like this
dpview = ... out = dpview(...) PlotlyView
Views on the Frictionless object are rendered on the page ...
Acceptance
Tasks
datapackage-views-js
for displaying viewsAnalysis
How it works
Frictionless Data View (https://specs.frictionlessdata.io/views/) in a Data Package. E.g. this is a simple one:
Convert the view to spec for the charting library.
_values
Algorithm for inlining the data ... - see https://github.com/datopian/frontend-showcase-js/blob/d8918ef6172d394e4bacff4fb8acbd4102fa0ebf/src/index.jsx#L67-L85
_values
attribute on the resourceresources
is specified on view use that other otherwise use the first resource in the resource arrayHow it starts
Then becomes
Then becomes ...
https://github.com/datopian/datapackage-views-js/blob/bb08d2032e/__fixtures__/chart.fixtures.js
What do i want in a library ...
Given a Frictionless Dataset with a Frictionless View like ...
Use the library like this