Professional Documents
Culture Documents
As we will take input from the user, we will have to store the user
input data somewhere, so that later retrieve that data to create
the visualisation.
As we are taking item name and item cost as input, so for each
item we will create an object which will have two keys: name and
cost.
For this project, I have created two JS files. One for DOM and
another for D3.
We will write the logic to take input in the “script.js” file, and will
write the logic to display the output in the “graph.js” file.
Now let’s write the logic to take input from the user
Now let’s take the input and view it on the developer console.
With this, we are able to take the input from the user.
But here we have some challenges, the first is we are getting the
cost in string.
OKAY, now let’s apply some checks so that we get the correct
input.
The above code will now ensure that we get the expected input
each time.
OKAY!!!
By now we are able to take the correct input from the user and
able to store that in the firestore database.
OKAY!!!
We can take the correct input from user, we can store the input
to the firestore database and we can now also fetch the stored
data in real-time.
Now the next task is to create the visualization from this data.
That will be the end of this article, will meet you again in another
article. Till then keep learning, keep exploring and keep
practicing.
Thanks