Fundamental Visualizations
This example showcases six fundamental visualization techniques—bar charts, line charts, pie charts, scatter plots, and choropleths—implemented as reusable Chiasm plugins with D3.js. Each chart is an independent component with no shared dependencies, demonstrating how common visualization methods can be modularized and combined in a single dashboard layout. The bar charts support both vertical and horizontal orientations with configurable margins and spacing, the line chart uses historical trade data, the pie and donut charts show categorical proportions, the scatter plot uses Fisher's Iris data, and the choropleth displays US demographic data. The design emphasizes encapsulation and simplicity, with duplicated styling code across components to illustrate a standalone-component architecture. This serves as a foundation for building more advanced visualizations with axes, labels, and interactions.
AI-generated descriptionFundamental visualization techniques as Chiasm plugins. Inspired by:
- Graphical Perception: Theory, Experimentation, and Apllication to the Development of Graphical Methods by William S. Cleveland and Robert McGill
- Chiasm Boilerplate
- D3 Bar Chart example
- D3 Line Chart example
- D3 Pie Chart example
- D3 Scatter Plot example
- D3 Choropleth example
Goals of this example:
Provide a starting point for developing more advanced visualization components. Directions to go from here include adding axes, labels, legends, tooltips, and brushing.
Show how each visualization technique can be encapsulated as a standalone piece of code, with no shared dependencies between components. This is why, for example, code for margins and styling is duplicated code in many components. These things could conveivably be refactored out into common modules shared between visualization components.
For a more advanced example that adds brushing interaction to a scatter plot, check out Focus + Context Scatter Plots.
Data includes:
barChartData.csvbarChartData.jsonFake data to approximate the Cleveland & McGill bar charts.lineChartData.jsonThis data is from William Playfair's famous visualization of England trade imports and exports from the 1700s. This data was extracted from this example, part of the blog post Dimple as htmlwidget.pieChartData.csvpieChartData.jsonCopied from this D3 Pie Chart examplescatterPlotData.csvscatterPlotData.jsonThis is a random sample of 25 entries from Fisher's Iris Data Set.choroplethData.jsonThis is a topoJSON file containing outlines for US States and demographic data. This data is published as a Shapefile as part of US Census: TIGER/Line® with Selected Demographic and Economic Data. Mapshaper was used to simplify lines and generate the topoJSON file.