zarino / plot-a-graph-tool Goto Github PK
View Code? Open in Web Editor NEWA ScraperWiki tool for making graphs out of datasets.
A ScraperWiki tool for making graphs out of datasets.
I get a mainly blank page, and this error message in the console.
code.js:214
Uncaught TypeError: Cannot read property 'table' of undefined code.js:65
On this "UN peackeeping stats" scraper in my datahub: https://beta.scraperwiki.com/dataset/c5jrnyq/view/asnpodi
I plotted some string categories against their numeric values (twitter screen_name of a bunch of tweets, against the retweet count for each tweet).
I ended up with the same string appearing multiple times on the X-Axis. This makes sense, technically, but wasn't what I expected. They should be grouped together.
The question is, if we GROUP BY
in the SQL command, what aggregate function do we use for the Y-Axis values? SUM()
or AVG()
or something else? Do we let the user decide?
Would it be possible to overlay controls on top of (or around the sides of) the graph itself? So you'd click the x-axis label to change the column used on the x-axis, etc.
You could even make it more tableauey by turning the x- and y-axes into drag and drop zones, with a list of columns down the side that users could drag over to the right axes.
Heck you could even turn the whole thing into one big drop target, with a list of graph types down another side, which the user would drop on the graph to change the type.
Which I find confusing - I expect it to be one checkbox, or two radio buttons.
I'm also not sure what it is going to do! (That perhaps because I'm making a scatter plot)
I didn't see a graph instantly (as I have 100,000 rows).
I therefore looked around for a button to "go" or "run".
I was particularly preturbed that it was getting data for two graphs I really didn't want, when it takes 30 seconds to get each set of data. (Not sure if it tries to debounce the requests - if it does, I was much slower than it)
When you select the same column in both the X-axis and Y-axis dropdowns, Google Charts gives you an ugly red error:
Not enough columns given to draw the requested chart.
This is because Google Charts is only getting passed one column of data. Why? Because our underlying SQL query looks like:
SELECT "some_column", "some_column" FROM "some_table";
And SQL collapses the two columns with the same name into one result column.
We either need to SELECT … AS …
and give the two columns different names, or we need to validate user selections before sending them to the database, and disallow selection of the same column twice.
When one of the checkboxes is selected, and then you check the other one, the chart doesn't update as you'd expect. Instead, it shows the old sort order.
This is because these two events are competing, and sometimes the second one wins:
$(document).on('change', '.mutually-exclusive :checkbox', function(){
if(this.checked){ $(this).siblings(':checked').attr('checked', false) }
})
...
$('section select, section :checkbox').on('change', refreshChart)
Please can we treat dates as numerical data, so we can do an xy chart with dates as an axis
Save every setting in SQLite db or a json file.
Make sure the saved settings get applied to the DOM on next page load.
It doesn't degrade gracefully on large queries and so prevents selection of small table in bigger dataset.
from Julian
At the moment, the tool allows users to select non-numeric columns when making a scatter graph. If they do so, all they get is a horrible red Google Charts error box.
Switching the chart type to ScatterChart should also disable any text/mixed columns in the x-axis select box.
I have a dataset of food product prices, over time. I want to plot a column or line graph with the date along the bottom, the price up the side, and different coloured columns/lines for the six different food types.
e.g. for the Twitter followers tool, I might plot followers against following, but the label for each point just shows me the two numbers and I'd have to go back to the table to figure out who that point represents.
It would be nice to be able to say, attach the screen name to the label too, so I can quickly look at, for instance, who unusual points represent.
This isn't a particular non-programmer friendly error message. Maybe referring to text rather than strings is more helpful.
Furthermore, why does the dropdown allow me to select columns which give rise to such an error? (There might be very good implementation reasons for this that I'm not aware of.)
Could the tool generate a HTML page with the Google Chart in it?
Or could it give me a link to a Google Image Chart with exactly the same settings?
When I'm choosing which columns to pick, would be nice if like in the "Query with SQL" tool it showed me a few random values.
I've a dataset with 10,000 rows.
The charts load, but with very long browser pauses. I expect at least a spinner to show it is working.
I'm plotting men vs. women
When I plot men vs. women on https://beta.scraperwiki.com/dataset/c5jrnyq/view/asnpodi and i hover over it it says
women
4337, 7
It isn't clear which dimension is which. I expect it to say:
men, women
4337, 7
or some such.
I partly want a magical "show me the right kind of graph" mode, where you just tell it the columns and it automatically picks the right graph type based on the column datatypes etc.
A bit like the Summarise this data tool.
Is that possible?
No idea why. Can't find any similar bug reports online.
Perhaps disable logScale if trendline is selected, and vice versa?
Perhaps defining a set chart size would help?
This might take a while for large datasets. We should show a spinner while we're populating the datasetMeta
object.
Aidan reported originally: "I cant on the emap datahub use the "plot this data" tool - no table to select"
Zarino says: "No javascript or ajax errors are reported. The SQL Meta endpoint returns the list of tables fine. Will need to investigate. It may be because findTypes()
isn't working, or the findTypes(meta).done(…)
on line 80 needs a .fail()
as well."
https://github.com/scraperwiki/magic-table-scraper-tool/issues/76
To say what it's about.
Will be more useful once you can actually save / share graphs.
I expect to be able to e.g. plot deployment date against number of men/women.
So I can flick to other tools and back again.
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.