-
Notifications
You must be signed in to change notification settings - Fork 34
D3JS API definition #200
Comments
Do you need anything from us before you provide API for data? |
Yup :) Just a simple prototype would be enough for that start. We would be able to evolve it but for now we need to understand what's required. |
For this three simple charts, we will need data (like label and value eg. label: "Anne", value: 8), and type of chart. I provide example of data: { where name is a label of particular bar and value should be a number. For start this should be enough, in the future we will try unify the data for more advanced charts, but let's start from this format of JSON. |
Hey, let's a bit modify json to have more dynamic charts. I provide example below: { in layout you can define type of data, and describe axes |
Hi @Dunkat , I think we shall separate the metadata from actual data because the scenario, from frontend side, would be something like:
wdyt? |
You are right. It would be good to separate the metadata from actual data |
Hi @Dunkat , ( Backend task: metasfresh/metasfresh-webui-api-legacy#184 ) NOTE: this is an working prototype which we can change it as we want ;) The layout is provided by dashboard endpoints:
After you have the layouts, using the dashboard item's ID you can query for data:
Example:
So basically,
Now let's fetch the data for that KPI: http://w101.metasfresh.com:8081/rest/api/dashboard/kpis/1000013/data You might get:
Remark the "data" node. There you will find the data items.
wdyt? |
This is a very a nice/ compact chart: Is a very nice fit for target indicator sized KPI. Has everything we need for that |
Another one that could be used as best/ worst performing comparison chart: |
We need to think about the scale on bar charts. Will the API provide absolute scale, or we'll point min and max values dynamically from the dataset? Another thing is data model. Current one is not really easy to get, and needs processing on frontend side. What I'm thinking of is every chart will display array of values. In pie chart there's only one set of such values, and angle represents part of whole sum. my suggestion of model:
data:
Such model should easily be rendered in both, pie and bar charts without too much data processing. imho, if the chart is pie type, we should actually render 3 pie charts. note: this model assumes, that the amount of values are equal to labels, and colors as it assigns corresponding label and color to value. wdyt? |
Hi @chmieludaniel , thanks for taking care. I have following observations...
Question: can u give me an example about how the responses shall look like in case we have a time dependent chart. |
Hi @teosarca, True - the labels, and colors can be a part of layout. In that case, the data, can be just an array (value of previous datasets). I'm not sure if I got the point. What's new when the chart is time dependent? I think the labels would be something like: Frontend would not take care of date format, just display the text/date labels in given format When it comes to pie chart in slices, then we would need to limit slices to But it's not for now, is it? Until then, can we assume, for the pie chart to always have only one dataset in data array? |
as @metas-mk commented on skype, the scale will be the same for each dataset. Saying scale I mean minimum and maximum value for y axis. But what about minimum step on y axis. Like here: |
quick examples for 6 KPI charts on dashboard: the 4 target KPI will be all metric things in the first step |
Tested. Works very nicely and just in time for Chemnitzer Linux Days. Was an awesome experience for the visitors. |
Add metasfresh/metasfresh-webui-frontend-legacy#200 to the upcoming release.
After created proof of concept of D3JS Integration into metasfresh WebUI, we can now start to define the API, needed for different chart elements. Please provide a concept suggestion. Samples of charts we could begin with
Bar Chart: http://bl.ocks.org/mbostock/3885705
Pie Chart: http://bl.ocks.org/dbuezas/9306799
Area Chart: http://bl.ocks.org/mbostock/3883195
Link to D3JS POC Task:
metasfresh/metasfresh-webui-api-legacy#64
The text was updated successfully, but these errors were encountered: