it2901-sintef01 / frontend Goto Github PK
View Code? Open in Web Editor NEWFrontend for our open data visualisation platform.
Home Page: https://sintef01.netlify.app/
License: Apache License 2.0
Frontend for our open data visualisation platform.
Home Page: https://sintef01.netlify.app/
License: Apache License 2.0
Make chart type dependent on vis. selected -- i.e. information available in global store after #85.
It might be easier to have all visualisations accept an object (i.e. one argument) and use some clever mapping between input and output.
Even though it's not crucial for our application, we should strive to hit at least the most basic accessibility goals.
The task is to perform a review of the accessibility (or lack thereof) and provide a report to the frontend developers through an issue with subtasks. Might also be helpful to include a PDF or similar.
Edit sider config.
Don't lint generated files.
In case the server gets hurt we need an error page.
This is low priority.
Go wild π¨π»βπ€
50x.html
in /public
which will be shown upon error π€§For the MVP of the dashboard, we need a fitting visualisation.
The visualisations should take one data format, which is fitting for that visualisation. So for a bar chart, you may want { x: [1, 2, 3], y: [4, 5, 6] }
&c.
atoms
folder (if #26)Depends on #3
Mocks only return one title for the visualisations, while it should return a sample (read: one) of all available data sources for randomness.
Very random (:sparkles: quirky β¨) selection.
I got it to work with using proxies on frontend.
Steps to reproduce:
"proxy": "http://localhost:5000",
<button
onClick={() =>
fetch('/graphql', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: `{"operationName":null,"variables":{},"query":"{ forecast { forecastGeometry { coordinates } } } "}`,
})
}
>
test
</button>
Remember that when proxying you need to make a request to the host you're serving the app from. This is done by default when omitting the host in the fetch
request, and only including the path.
Originally posted by @FredrikAugust in IT2901-SINTEF01/backend#29 (comment)
How does Storybook work, what are some best practises, how will we use it, an example?
Implement the actual functionality (updating global state) that adds the data source + visualisation.
Build the application in a docker image and publish to organisation βΒ just like backend.
An umbrella repo will be created which deploys both of these (with a DB in the future) with a docker-compose "image".
Create a type which corresponds to the response of the MetAPI call. Hopefully, soon you will be able to use the backend to retrieve this data, but this is currently under review.
This type will be the type of the deserialised result from the GraphQL query. If you have any questions about how this works, @blauks should have some knowledge from Ekskom!;)
The dummy data you create could be a JSON file you put in a sensible location, or a JS object in a file. You only have to make sure it's an exact match between the type and the data.
const sample: MetApiCompactForecast = { ... };
)Document how to set up and use Storybooks.
Helpful notes from @FredrikAugust
Useful points:
- File name format. With this configuration, they have to be (in effect) *.stories.tsx
- How does a story look? Perhaps provide an example
- Should you be able to test container components, or only presenational? If you should be able to test container components, it might be useful to provide a wrapper.
This project should be usable as a npm library.
Storybook invalidates all components as they differ in textual content.
PLEASE ππ»
It also makes all builds in master pending as they're not accepted.
No diff.
Flow:
A review of the application accessibility can be found here. The review provides an overview of tasks to be done and explains the tasks below in greater detail.
A question mainly for @IT2901-SINTEF01/ux-design, but including @IT2901-SINTEF01/frontend as this will determine their choice of technologies.
When developing dashboards and visualisations it's important to strike a good balance between utility and β¨ aesthetics β¨.
We should probably set some guidelines for the visualisation of data with regards to amount of information, design &c.
Example questions:
It's a fine line, but I believe it should be at least given some discussion.
Using react-router
one should be able to navigate between the two pages as specified in the design kindly provided by @IT2901-SINTEF01/ux-design.
localhost:3000/#/path/to/resource
. This is a sign of misconfigurationAdd a workflow to install packages and build project
Right now, the query used on the dashboard is not correct, and this needs to change.
We are gathering an army and preparing to tackle this enormous hindrance.
Sharpen your tools, we're going into war.
Remove lint action since we have sider.
Build master
builds and push to github pages.
Continuous deployment of master
should be sufficient as long as we configure the backend path in env vars and ensure CORS settings on backend satisfy the requirements.
To provide some more interesting data to the components in the storybook (as well as avoiding having to store large JSON files everywhere) we can use a mocked provider from apollo.
The user should be able to select a visualisation from the ones generated in #84, and this information should be passed to the global store.
As discussed in the meeting.
Add page for accepting the addition of a new data page.
Good morning!
Next up, we need a page where the user can select what data source they wish to use for their visualisation.
In this issue, you only need to implement the page. You do not need to wire it up to a global store for handling selection of data sources.
Right now it appears to be using shallow object comparison which means that it will always pass.
With TypeScript, TailWind, Apollo Client and other needed dependencies.
Right now data source is based on the title of the metadata entry that is returned[0]. This is error-prone as some of the titles are quite long and complicated.
It would be better to migrate to a more uniform ID format.
[0] #81
Might be useful to ensure the storybook builds successfully in Github Actions?
Evaluate whether or not this is performed by the original building. I do, however, believe that it is possible for the storybook to fail building without the main build failing.
Create wireframes in Figma. Post link or images here when done.
Our Docker configuration doesn't seem to like non-null assertions, generic components and several other modern TypeScript features. It should support this.
as
casting.Example: https://github.com/IT2901-SINTEF01/frontend/pull/72/checks?check_run_id=2148614277#step:8:171
No errors.
Deduce from docker builds and Github Actions files.
A threshold chart will not be the best way to visualise population data in Norway. We should create a new component for line charts which can be added to our library of available visualisation methods.
The datasets might take some time to load, and may even produce errors. We should have visual components representing these outcomes.
It doesn't look good.
π·
Make a test (or two) to check the business logic related to adding a new item to the dashboard
Implement an atomic design pattern, and make sure the rest of @IT2901-SINTEF01/frontend understand what this entails.
Some key concepts;
useQuery
to retrieve from the GQL endpoint.parent* = parent, grandparent, great-grandparent, &c
.keep
files if you need to push empty foldersCreate a dashboard component which supports multiple child components (visualisations)
Dashboard
organismprops.children
)E.g.
const rawMetApiDataToBarChar: (rawData: MetApiData) => BarChartProps['data'] = (rawData) => {
// ...
}
Afternoon, @IT2901-SINTEF01/ux-design.
The task is to create a more complete design in Figma that the @IT2901-SINTEF01/frontend team can use as a baseline for their implementation.
Wow! A complete e2e test!
You should test that adding a data visualisation and navigating between the relevant pages works as expected.
This is actually a bit more work than illustrated by the title.
The backend metadata field returns a set of visualisations which have a type
field, which we can map to different component types (e.g. ThresholdChart
, BarChart
, &c).
We need to use this information, alongside the information regarding what data source we are working with to retrieve the correct mappingFunction
, map the data to the correct format, and inject it into the visualisation. This requires some changes to the way the mapping function is retrieved today.
With this issue (and corresponding PR) you should be able to view the different visualisations available to the data source.
visualisation
object from the backend includes some metadata which should be passed to the visualisation (e.g. name
, axesName
&c)visualisation['type']
to chart typevisualisation['type']
to mapping function (with data source added to the equation)This issue does not include the actual mapping of real data to the different visualisations. That will be handled in another issue. This does however lay the foundation for that.
We need custom atoms for loading and errors which can be displayed when fetching data from the backend.
This should be done once the design is at least partially complete βΒ to the point where colours have been set in stone.
The frontend needs to keep track of which visualisations are selected, and a global store is a suitable place for that. I believe @emilom found the Apollo state management to be sufficient, so that should be used.
Examples could be P5js and threejs, try to experiment with them a bit aswell too see what we could do with them.
Post your findings here!
Read title of issue.
![Deployment badge](https://img.shields.io/github/deployments/it2901-sintef01/frontend/Production?label=Production%20deployment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.