dmarx / Reddit_response_to_Trump

Quantifying the Reddit community's response to US political turmoil following the election of Donald Trump
3 stars 2 forks source link

Add drop down filtering #1

Open dmarx opened 7 years ago

dmarx commented 7 years ago

Filters:

Complexities:

Button Description is_russia is_megathread g_col
button0 0 0 0
button1 0 1 0
button2 1 0 0
button3 1 1 0
button4 0 0 1
button5 0 1 1
button6 1 0 1
button7 1 1 1

This is uglay, but from plotly's "custom button" docs, it appears to be their recommended practice. Reference the "all" and "both" options in the "relayout" and "update" button demos.

dmarx commented 7 years ago

This looks like a way more versatile and customizable solution:

Related resources;

dmarx commented 7 years ago

GraphWidget is designed for hosted plotly graphs, not offline mode. Here's a demo of a possible solution for offline mode:

NB: This solution completely redraws the chart rather than updating it. There's probably a better way.

dmarx commented 7 years ago

This will work locally but according to this, widgets won't display in nbviewer, which makes sense: rebuilding the chart each time this way requires running a bespoke python function. Obviously I need a running kernel for this to work. Might still be fun to play with and worth implementing as an experiment and learning experience, but not the way to go if my goal is build something random people online can use simply.

dmarx commented 7 years ago

This hasn't been updated in two years, but might be worth checking out: https://github.com/plotly/postMessage-API

dmarx commented 7 years ago

I thought the control elements I had been playing with were the newly deployed features I had read about, but it looks like that's a new dashboarding package called "dash", which I may need to install separately:

I have a feeling if widgets won't work on nbviewer, neither will Dash. Uses Flask and socketio in the backend... not super optimistic. I need the ability to embed JSON and/or manipulate the d3 directly.