Has anybody implemented an instance d3.js in drupal 7 successfully?
I plugged in the main d3.js libraries into the page header without problem... but I get all sorts of errors when I try to put code that actually draws something into a page or block...
Somebody managed it with protovis a couple of years ago... http://drupal.org/node/516282#comment-2232740 and i was trying to work along the same lines.
A module package something like the one for http://drupal.org/project/thejit would be a big timesaver.
Thanks for any clues/guidance/examples!
There is a conversation in progress at Drupal.org about this.
And there's a sandbox module in progress that can be grabbed at
git clone http://git.drupal.org/sandbox/asherry/1477334.git d3
D3 is amazing!
A stable D7 module is probably 4+ months away but you never know.
Here are some contributed module suggestions for D7, which may help to use the D3.js library in a Drupal site:
Charts and Graphs (Official release available).
Charts and Graphs is an API for developers. It can be extended by third-party modules that want to add their own charting implementations. It does nothing by itself. It should only be installed if some other module requires it.
D3 (Alfa release only)
creates visualizations as libraries (alpha version only) which allows one to add/remove visualizations, share them between modules, and integrate them with (for example: Views) through library .info files.
The Basic module configuration presentation provide a short intro about how to use the module in combination with Views.
Forena (sandbox only)
Refer to issue # 2383509 for more details.
Knowing what errors you get would definitely help us help you.
One hint : you have to be careful about the way you add your script to prevent namespace problems. Another important thing is the scope your library is using (JQuery, $, etc.) as Drupal includes its stuff in a specific way.
The conversation posted by #ted.strauss is now closed: it is possible to have D3.js directed layout as an engine for graph_api.
The main page for the project d3 for drupal, by asherry is https://drupal.org/project/d3.
As far as I'm concerned chart integration (which doesn't need graph_api but is directly managed by d3 module) works very well.
Related
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.'
I am currently building a small meteor based quoting tool application. I would like to add Google's material design to it and and having a hard time to decide what is the best way to do that.
I would like to hear from someone who has done this, am I in right track and what are the potential issues with solution options below, or is there better existing solution?
Installing polymer to public folder and use bower to build the client packages.
Installing materialize CSS using Atmosphere package https://atmospherejs.com/materialize/materialize
Using momentum https://atmospherejs.com/percolate/momentum to roll my own components https://atmospherejs.com/percolate/momentum
Elements I want to use are paper-elements + Google drive and sheets, plus might need more in the future.
If you go the Polymer route, you will be able to use the paper-styles component. It would require manual application, but it'd give you the most authentic Material Design experience. In addition, you can use the various paper elements directly, swapping out normal input elements for paper-input, for example.
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.
I know almost nothing about this sort of thing, so please forgive the newbie question.
I want to put together an open-source online literature annotation system. I hear this sort of thing is easier to do with frameworks like Drupal or Django, but I don't know very much about them. I found some Drupal plugins that handle text annotation. Is that the best way to go?
Oh by the way, if anyone is interested in contributing, please contact me, because I could use all the help I could get. I've been putting up ideas at http://hyperlit.tiddlyspace.com/
Annotator by Open Knowledge Foundation might do what you want - used by OpenShakespeare...dual MIT/GPL, code is on Github, has a couchdb backend but you can develop your own storage since it is separate from the javascript annotation tool.
I have an idea to use drupal as a document repository and integrate okfn annotator but very much an idea, not a project (yet) - my particular use case is commenting on legislation/draft legislation.
For Drupal, these potentially might do what you want (in various states of development/functionality):
Open Review
Yellow
marker
discussions on Marginalia but no
movement
Sticky Notes and other older modules did not fit my use case
[ http://drupal.org/project/sticky_notes ]
EDIT: Commentpress for wordpress might get you up and running quickly with limited features.
I'm looking to see if anyone has any resources or tips for developing basic Drupal modules faster? Have you come up with anything to make your Module development faster?
The Drupal module documentation is kinda hard to understand and pretty massive. I'm wondering if anyone has simplified it and given techniques/tips for getting specific things done quickly. I'm currently looking for Drupal 6 and 7. Any help saving time will be greatly appreciated :-)
In general, I'd recommend picking up a copy of the Productive Programmer. There's nothing earth shattering in it, but there are lots of small tips that can increase your productivity incrementally.
For Drupal specifically, Pro Drupal Development and Pro Drupal 7 Development, though not focused strictly on speed of development, are indispensable.
Beyond that...
in the first place, if you don't have to, Don't Write Code
get familiar with the most commonly used hooks
learn to use Drush and Drush Make
learn to use Devel and Theme Developer modules
use the Schema module to generate your module's schema code, based on an existing table
use the Data module (+ this patch) to generate the code to expose your module's tables to Views
use the Form Builder module to generate form code
use Coder to learn the Drupal coding standards, which will help others help you
set up "quick searches" to allow you to quickly search api.drupal.org
learn the shortcuts in your IDE or text editor (I like Netbeans partially because of the Drupal plugin); print out a good cheatsheet
learn to use version control effectively
Well, there really no fast track to it. If you understand the Drupal API regarding module development (install, menus, blocks, forms, etc) you will grasp it. The hardest part I remember was wrapping my head around the menu system.
One thing that helped was taking simple modules and seeing how they worked, and problem solving my own solutions. Reading Pro Drupal Development helps too.
You basically need to have an understanding where to look (API function, hook, system... ) when you want to do X. There is really no need to memorize all hooks/functions in detail with all the arguments and stuff. That's something you can easily look up. Especially if you're using an IDE with I suggest (Using Netbeans myself).
Especially when you're altering stuff, try to develop some techniques to quickly figure out what code is responsible for the stuff you want to change. One example is to look at the hook_menu() definition of the module that does it and then check out the page callback and skim through the code. Things to look up: Are there hooks you can use, is it a form (if yes, what is the form_id, how is the form structured) and so on.
The best and maybe only way to get there (knowing where too look) is exercise. Every time you do something, you'll be faster the next time when you have to do something similar. I think what also helps is working on core/contrib modules together with others. You not only get to learn these modules better, you also learn how to read and understand code written by others better and you improve your own coding style.
Try to utilize proven, generic "building block" modules like Views, Flags, Panels, CCK/Field and so on. Then, the heavy lifting is done by these modules and you only need to provide the glue code to properly integrate them with your site. Might take a bit more time the first time you use these modules but you will likely save a lot time after that.
That having said, I'm not sure if the goal should be to build modules fast. I'd say the goal is to build modules better. Try to make them generic, secure, flexible, theme-able and so on with the goal to re-use these modules on the next site your building, when you need something similar.
The majority of basic drupal module development is copy and paste. If you use textmate, the Drupal bundle for it allows you to build up key bits of modules (menus, theming functions etc) just by point and click (as it contains most of the necessary code snippets; you just fill in your info).
Following the module building tutorials is good too; the truth is, if you spent 3 or 4 weeks doing it day in day out, and you already have some background in coding, you'll be just fine.
Gedit for Drupal will preconfigure the very good Gedit editor/IDE for you.
For example, a new module: create an empty module file mymodule.example. Enter that file.
module<tab> And it expands into a full, predefined module.
Or in any module: hook<tab> to see a list of available hooks. Choose e.g. menu<tab> and it expands to a full predefined hook_menu. With <tab> you can walk trough all the variable parts in that new hook, to fill in the details.
Drupal.rb Has a.o. a $ drupal generate module "modulename" command that opens an interactive shell, wich allows building scaffolds for modules. The templates from which these scaffolds are built, are overridable.