All Projects → tmcw → d3-axis-for-react

tmcw / d3-axis-for-react

Licence: other
d3-axis for React

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to d3-axis-for-react

Keen Dataviz.js
Data Visualization Charting Library
Stars: ✭ 215 (+241.27%)
Mutual labels:  d3
Visavail
A D3.js Time Data Availability Visualization
Stars: ✭ 245 (+288.89%)
Mutual labels:  d3
ddplot
Create D3 based SVG graphics easily from R
Stars: ✭ 43 (-31.75%)
Mutual labels:  d3
Reaviz
📊 Data visualization library for React based on D3
Stars: ✭ 215 (+241.27%)
Mutual labels:  d3
Plotly Graphing Library For Matlab
Plotly Graphing Library for MATLAB®
Stars: ✭ 234 (+271.43%)
Mutual labels:  d3
P2p Graph
Real-time P2P network visualization with D3
Stars: ✭ 245 (+288.89%)
Mutual labels:  d3
D3 Ng2 Service
A D3 service for use with Angular.
Stars: ✭ 210 (+233.33%)
Mutual labels:  d3
d3-force-graph
Force-directed graph using D3-force and WebGL, support massive data rendering and custom style.
Stars: ✭ 74 (+17.46%)
Mutual labels:  d3
Gtr Cof
Interactive music theory dashboard for guitarists. http://guitardashboard.com/
Stars: ✭ 244 (+287.3%)
Mutual labels:  d3
Freecodecamp
freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.
Stars: ✭ 339,510 (+538804.76%)
Mutual labels:  d3
Id
🆔 The easy-to-use OpenStreetMap editor in JavaScript.
Stars: ✭ 2,667 (+4133.33%)
Mutual labels:  d3
Git Deps
git commit dependency analysis tool
Stars: ✭ 232 (+268.25%)
Mutual labels:  d3
Webpack Ops
📁 webpack bundle visualization // optimization // config tool
Stars: ✭ 251 (+298.41%)
Mutual labels:  d3
Netjsongraph.js
NetJSON NetworkGraph visualizer based on d3.js
Stars: ✭ 216 (+242.86%)
Mutual labels:  d3
kotlin-js-D3js-example
A simple example of a D3 JavaScript program in Kotlin
Stars: ✭ 13 (-79.37%)
Mutual labels:  d3
Architecturetree
Draw and share your software architecture without diagramming software. Uses d3.js and Angular.js.
Stars: ✭ 211 (+234.92%)
Mutual labels:  d3
Chart Tool
A responsive charting application
Stars: ✭ 244 (+287.3%)
Mutual labels:  d3
sankeydiagram.net
sankeydiagram.net is an easy-to-use webapp for generating Sankey Diagrams to visualize flows and budgets.
Stars: ✭ 51 (-19.05%)
Mutual labels:  d3
vue-d3-template
A template project for using Vue with D3.js (easy serve on github.io)
Stars: ✭ 16 (-74.6%)
Mutual labels:  d3
Netwulf
Interactive visualization of networks based on Ulf Aslak's d3 web app.
Stars: ✭ 254 (+303.17%)
Mutual labels:  d3

d3-axis-for-react

Using d3 to build charts in React is mostly a wonderful experience. But it's hard to use d3-axis with React: it internally uses d3's selection system, so if you're creating your charts in React with JSX, you can't.

This is d3-axis, but for React. As direct a port as you can get. You can essentially read the API Reference for d3-axis, and translate it directly to this component: for every d3-style setter function, use a prop. The scale argument that you provide to the axis method is a scale prop.

  • Tiny: No dependencies. React is a peerDependency and this package does not depend on d3.
  • No new opinions: Same API as d3, just with props instead of methods.
  • No animation: d3's axis system supports transitioning. This does not: that's out of scope.
  • No canvas: d3-axis is compatible with Canvas thanks to d3's selection/context system. This component only targets SVG.
  • TypeScript included: written in TypeScript, includes types.
  • Compatible with server-side rendering: this doesn't use useEffect or any hooks: instead of using d3 to create DOM, this uses React.

Installation

This is the d3-axis-for-react package on NPM, so:

$ yarn add d3-axis-for-react
# or
$ npm install d3-axis-for-react

Translation example:

Traditional d3 style:

d3.axisBottom(x)
  .ticks(d3.timeMonth.every(3))
  .tickFormat(d => d <= d3.timeYear(d) ? d.getFullYear() : null)

With d3-axis-for-react

<Axis
  scale={x}
  ticks={d3.timeMonth.every(3)}
  tickFormat={d => d <= d3.timeYear(d) ? d.getFullYear() : null} />

Examples

📚 API documentation


Development supported by Earthrise Media. Adapted from d3-axis, written by Mike Bostock, licensed MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].