How to build a Simple django live dashboard - bokeh

I'm trying to make a dashboard which updates live using Django framework. Since i'm a newbie to Django, don't have an idea on how to build a live dashboard. I tried SO and few github repositories which didn't help me, either they have only a live plot or a way complex dashboard, which i don't understand. Please help to provide any simple Django live dashboard example, which i can use as a base to build my dashboard.

I'd suggest you break the problem in chewable chunks.
For example:
For the backend:
What does a dashboard consist of?
- It can contain workspaces(an abstraction - to contain widgets)
- Each workspace then can contain widgets
- Widget can be of different types based on visualizations
Bar chart widget
Line chart widget
Stacked chart widget
...
Each widget will also have controls like date filters or other filters
You would also need a way to filter your data, so, some abstraction which gives you data based on widget type and settings that user chooses on the frontend.
For the frontend:
- Choose a charting library and based on that you can fetch configurations for the widgets from the backend
- A way to poll your backend periodically for getting live updates
This is not at all a fully baked architecture. Go and take a look at https://django-dash.readthedocs.io/en/latest/#screenshots for a good architecture which I'm exploring myself.
I hope it helps. Happy coding!

Related

Javascript chart example

I saw charts in BSI CRM, and they look awesome. I tried to find online tutorial about making own widgets, everyone reported to look at heatmap example code, but it is confusing. Where to start?
But I would like to see a tutorial to show simple chart or any other javascript widget in scout. I need steps where to start..
Is there any tutorial, can someone write it. Only in few lines?
Thanks
To use charts in a Scout application you have to choose a chart library and include it into your project. I’ll give you an example with ChartJS. For you it is probably easiest to look at the commit (link below) to do the same in your project. I’ll write a short cheat sheet on ‘How to integrate ChartJS in Scout applications’ within the next days and link it as soon as it is available.
Depending on what you are using, ScoutJS (JavaScript only) or Scout Classic (Java based application model), the integration of external libraries differs.
ScoutJS:
Commit: 'Added ChartJS example to JSWidgets app.'
Scout Classic:
Commit: 'ChartJS example for classic widget app.'

Xamarin Templates -IOS

I am currently learning app-building basics with Xamarin. My question is what is the difference between "Blank-App (iPhone)" and "Master-Detail App (iPhone)".
Thanks for taking the time to answer my question.
These are two different templates for you to choose.
Blank-App (iPhone) means you just create an empty project without storyboard, RootViewController or other extensions. You can customize it whatever you want. If you are new to Xamarin.iOS and unsure about what template to use, try to use Single View Application.
Master-Detail App (iPhone) means when you choose this template. System will automatically create a UISplitViewController with a default Detail and Master for you. So there's no need to configure the rootView. It's a type of showing the ViewController.
You can try to create these two template projects then run to see the difference between them.

Displaying multiple feature modules that use router in the same view in Angular

I have an use case in which I need to have multiple modules loaded in the view at the same time. Thing is, each of those modules might be as simple as a component, or a complex Angular module with a router and everything. I guess you could call it a plugable framework.
The number of modules I have to show or who they are is dynamic (I'm getting them from a server).
My first idea is that it would be good for this case if the feature module's router wouldn't be a singleton with the main one and also if they wouldn't update the url completly.
Each of the feature module should be able to be launched as a stand-alone app if bootstrapped (therefore, I do need it to be able incorporate all Angular 4 features including the router).
I managed to get something working by playing with the router and with named router outlets (secondary routes) but not sure how good that is in the long run.
How should I approach this?
I am in the early stages of attacking a somewhat similar scenario. In my app, the UI is organized in panels that are designed to stand alone on smaller displays, or side by side on larger. I find this approach works well for my routes, as my app is designed to edit a complex, highly hiegraphical document with many inter-related sections. e.g. User follows link on list to open detail, new detail panel appears to right... follows link on detail to related node... etc.
The solution I'm noodling with now is attempting to use an ngrx store that interacts with the router (and router-store) to dynamically create panels based upon router data. Well, technically it does not create the panels, it only serves the data that tells a component what to create and render.
I know my situ is not exactly the same as yours, but perhaps there's something in my approach that may help you find usefull or at least thought provoking.

Drupal D3 module documentation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am attempting to create some visualisations in Drupal, and found the D3 module. However, I can't find much documentation. Could someone point me in the direction of a guide to using the module, or explain how to use it?
I have installed the module as described here, but I don't know how to get a chart to display on a page (I haven't used Drupal much either).
Basically I would like to know:
How does it work with Drupal?
What all Chart styles does it support?
How does it integrate with Drupal's Views and Panel in terms of generating visuals?
Thanks.
The d3.js module indeed seems to suffer some documentation issues. Moreover it still doesn't have an official release so far (only dev versions). The
d3.js library that this module integrates with seems to become more and more popular.
Refer to the Maintenance Scorecards for over 20 criteria to consider when selecting a module to create charts. By doing so, you might want to consider other charts related modules that can be used for creating charts in Drupal.
The number of reported installs indicate that either the Chart module or the Charts module is often considered as a viable module for creating charts in Drupal. For both modules quite some documentation is available also.
The Chart module's project page contains some information that indicates it is "being depreciated and users are recommended to move over to the Charts module". Though most recently some comments in the chart issue queue contain some details that illustrate that that depreciation is being reconsidered. Refer to that issue queue for more details on that.
If needed, do not hesitate to create an issue in the module's issue queue. As an alternative create a new question on this site (or Drupal Answers) and find a way to let me know about it (eg via some comment in any of my questions or answers around here).
Disclosure: I'm the maintainer of both modules Chart and Charts, and the author of the documentation of charts related modules mentioned in my answer also.
Note: In a future release of the chart module, support for the d3.js (as a charting library) is expected to be added also.
I have downloaded the latest version of the library d3.zip in /sites/all/libraries/d3 and installed the module. Once it is enabled (D3, D3 Views and D3 Examples), you can see in yoursite/examples some examples for the module. With "D3 Views" enabled you have the possibility of setting the format "D3 Visualization" in a view. You can use the view in your page.
Before I have worked creating some graphics with the module forena and the library SVGGraph. It is very well documented.
With d3 I have just started today testing but I got to create a graphic in the view how I told you above.
Good luck!
I have been working with this module myself, lately, and hope to have a live example up soon. As user28577 posted above, you should be able to use D3 Views (following the instructions) to create a view to display one of stock options (such as a bar or pie chart). Depending upon your knowledge of using Views in Drupal, it should be fairly easy to either create a new content type, or use an existing one as a source for your data that will be charted using the D3 module.
One possible reason (since I can't see your issue) you may not be seeing content is how your theme loads external JavaScript. I found this by toggling through different themes in one of my test environments, where some would not load D3 through an external library. Once I downloaded the latest build of D3 and placed it in sites/all/libraries/d3, things worked fine. It also allows development without an internet connection.
Without a good knowledge of the Drupal API, it can be challenging to source your data to chart if building a custom visualization. Although it's not the "Drupal Way", one workaround may be enabling the PHP filter (part of Drupal core), and posting your visualization into an existing content type, such as a basic page. You should be able to view this fine. But keep in mind that all data must be edited manually, and be aware of possible security holes.
I know this is an old thread, but I'd like to add a few things for people continuing to read this.
I apologize for the 'work in progress' documentation, but the
module itself has been a 'work in progress'. The module is now in
alpha1, and so documentation is in the works.
The module takes a completely different approach to
visualizations then that of modules like charts, and
chart. In terms of the API itself, those modules take a more 'php in, js out' approach. That is to say, you build the visualization primarily in php, and the module will handle all the JS for you. What the d3 module does is let you add 'libraries' via the libraries module, which are actual d3 code snippets wrapped in some code that Drupal reads. You can add and remove them much like modules. You can also make libraries dependent on other libraries. These give module developers and d3.js developers the ability to customize and add in any d3.js code because it's not baked into the module. The downside is that there is a little less 'out-of-the-box' magic.
These libraries also have .info files which can contain mapping information to take data from views, for example, and map that data into your d3 drupal library. You then customize that mapping in the views settings.
There are a few libraries that ship with the d3 module, but there will soon be a few larger and extensible repositories of libraries that are Drupal-ready. The idea is that there two huge communities - The Drupal community that builds thousands of modules for use, and the d3.js community that builds thousands of visualizations for use. Those will meet together and all of those libraries will be ready to add to a Drupal site just like you would a module.
Clearly documentation for the D3 module is a "work in progress". You can view the progress here, but it looks like you will need to rely on trial-and-error and results from other community members.
Basically D3 modules provide UI reach visualization of following types
Chord Digram
Force-Directed Graph
Treemap
Scatterplot Matrix
Bubble Chart
Pie Charts / Donut Charts
Multiple Line Graphs
and few more
Through library D3 gets well integrated with Drupal at presentation as well as Business layer. It is always much ahead than Charts module in terms of its styles and usability aspect.
D3 also avails VIEWS style formatters which can applied on the data manipulated through VIEWS and PANEL modules.
Even Visualizations build through D# and Drupal can be available for the DOWNLOAD apart from presenting onto the page.
Please visit - YouTube Video for further information.

Best practices approach to multiple views in meteor?

Every tutorial/example i can find for meteor shows a single view application. I would like to build something a little more complex. I'm unclear how to approach multiple views...preferably in a way that's somewhat scalable?
The iron-router package lets you access different views (layouts) by nice, REST-ful human-friendly clean URLs. It supports parameters in the URL, "loading" templates, waiting for subscriptions to finish loading, before and after hooks etc.
At this point you can only create Single Page applications with Meteor. Note that Single Page, doesn't mean you can't have several views - use iron-router for that.
But by design, Meteor serves a big fat unique JavaScript/HTML/CSS application down to the browser, though there's a feature request to allow incremental loading. It is then up to the application (or more precisely, the JavaScript framework), to dynamically render its views in order to display different "pages".
I was wondering the same thing and it took me way too much time getting something started. I finally got a paged app working solidly by using Backbone views and routes, so I created a simple boilerplate project to make setting up an app like this easier in the future.
Live demo here: backbone-boilerplate.meteor.com
Source code here: github.com/justinmc/meteor-backbone-boilerplate
Have you looked at madewith.meteor.com?
A bunch of apps there have multiple views using Backbone also Jonathan Kingston who created britto has started simple meteor framework called Stellar
At this stage of the game not sure if there really are best practices. But these two seem to be the current flow.
You can also make a tabbed interface for multiple views. There is a package project "Smart package for generating a tabbed interface with pushState" github project here: https://github.com/possibilities/meteor-tabs
The best solution right now is using a routing package (router is basic but works). The workflow is something like this:
declare routes; return a template name for each route
place the reactive helper provided by the package in your body tag
the reactive helper will return the template associated to that route
you create a template for each route and optionally set custom publish functions
Router will give you browser history (client side).
Note that at this time there are some limitation on the way Meteor handles html/js. They are load all at the same time. The bright side is that once the app is loaded, page transitions will be instant.

Resources