#1 By: Richard Snape, March 12th, 2014 09:03
I think it would be great to have a button on the main smartspaces site pages called "start a forum discussion about this page". It could create a topic with a link to the page (including date ranges if my other feature requests can be implemented ) already in the body text alongside the name of the page.
I'm happy to assist with coding and / or designing any of my cheeky feature requests
#2 By: Graeme Stuart, March 12th, 2014 09:15
I agree, this would be a neat link between the smartspaces site and the forum.
If you are able to help then it may be possible. I'm inclined to try to get this feature (which may be the hardest) working first, followed by this one (trivial once feature 1 is implemented) and leave the interaction with discourse to last. Are you interested in learning d3.js?
BTW: I have moved these topics into the meta category for now. If we need to subdivide meta then we can do that later.
#3 By: Richard Snape, March 12th, 2014 09:41
yeah - happy to learn. A quick squint at the source of the page and your detail.js file seemed to offer two options
- limiting the data returned on your JSON api call (which looks
like it would require a change to your JSON api), or
- making the d3 graphs work on only a subset of the returned data.
Option 1 would probably speed up the page load and processing, but might mean a real aggravation in back-end programming. I'd be happy to learn d3 and think about how to get parameters off the request to display only a subset.
Are you happy with the ddMMyyyyhhmm date time format? If not - what would you prefer.
#4 By: Graeme Stuart, March 12th, 2014 10:16
Its a big number 2. Primarily because the page has the annual slider at the bottom which relies on having 12-months of data available.
On a side note, optimisation is possible by loading only the latest week (or the requested period) initially for rendering the charts and then downloading the full annual dataset in the background to swap in. This would be fiddly as sliding would need to be disabled until the full data were downloaded. In any case, this doesn't address the feature request at hand.
Limitations: A page reload would reset the slider to the position specified in the original request after the user moves it. Not a problem.
My preference would also be to move the chart 'widget' code into a separate js file that defines a kind of d3.js object. as with the smiley faces. I would like to make it reusable and configurable. The faces code has been iterated a number of times but the charts are still in a very primitive form with lots of the code still a direct lift from a d3 example.
#5 By: Richard Snape, March 12th, 2014 10:23
Cool. I'll have a go at a rough cut if I get some time.
#6 By: Graeme Stuart, March 12th, 2014 13:02
BTW. Have a look at this topic. It is concerned with the discourse API. Which seems to be unstable at the moment.
Having said that the list of routes from this post look fairly straight forward and well designed. Its just all the checking to see if you're logged in and whatnot that might be a headache to design properly.
There might be a few libraries already in development we could use or draw inspiration from. for example this is a java client...
Also, for d3.js, this example might be worth studying. Its very responsive compared to my current implementation but this may be due to the smaller dataset. There may be a significant optimisation in the way the slider filters the data.
#7 By: Richard Snape, March 12th, 2014 13:16
Cool will do. Tomorrow, though. Home now.
[UPDATE] Had a read through all that. Basically, you need an API key to do this. Which in turn looks like it would require a user to be pre-logged in to allow this
This post and follow up on HowToGeek implies that the Discourse devs don't really like the idea of this kind of button.
I can see ways around it - we could have a user that exists solely to have an API key and check whether user is logged in and, if not, offer them the login / create account splash. Once that's done - it looks like you can query to generate an API key for the logged in user. Sounds a bit complicated all in all. I'm a fan of getting the range on the detail graphs working first.
#8 By: Graeme Stuart, March 17th, 2014 10:41
This feature is a bit tricky and needs some thought. There may be better ways to deal with this use case. For example it may be possible to embed a discourse topic directly on the page as comments.
For now I do not plan to pursue it particularly actively. I think its worth waiting to see what the discourse community comes up with.
In particular, this blog post by eviltrout (one of the founders of discourse) indicates there is already a way to do this.