All Projects → derhuerst → Svg Radar Chart

derhuerst / Svg Radar Chart

Licence: isc
Generate SVG radar charts.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Svg Radar Chart

Picasso.js
A charting library streamlined for building interactive visualizations for the Qlik product suites.
Stars: ✭ 175 (+288.89%)
Mutual labels:  svg, dataviz, chart
Ngx Charts
📊 Declarative Charting Framework for Angular
Stars: ✭ 4,057 (+8915.56%)
Mutual labels:  svg, dataviz, chart
Amcharts4
The most advanced amCharts charting library for JavaScript and TypeScript apps.
Stars: ✭ 907 (+1915.56%)
Mutual labels:  svg, dataviz, chart
Svg Patterns
SVG patterns for Data Visualization.
Stars: ✭ 201 (+346.67%)
Mutual labels:  svg, dataviz, virtual-dom
Go Chart
go chart is a basic charting library in go.
Stars: ✭ 3,254 (+7131.11%)
Mutual labels:  svg, chart
Awesome Dataviz
📈 A curated list of awesome data visualization libraries and resources.
Stars: ✭ 2,905 (+6355.56%)
Mutual labels:  dataviz, chart
React Jsx Highcharts
Highcharts built with proper React components
Stars: ✭ 336 (+646.67%)
Mutual labels:  dataviz, chart
Vue Bar
Simple, elegant spark bars for Vue.js
Stars: ✭ 414 (+820%)
Mutual labels:  svg, chart
multi-chart
lit-element building blocks for charts and visualization (based on d3.js v5)
Stars: ✭ 24 (-46.67%)
Mutual labels:  chart, dataviz
Britecharts
Client-side reusable Charting Library based on D3.js v5 that allows easy and intuitive use of charts and components that can be composed together creating amazing visualizations.
Stars: ✭ 3,688 (+8095.56%)
Mutual labels:  svg, chart
Django Rest Pandas
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)
Stars: ✭ 1,030 (+2188.89%)
Mutual labels:  dataviz, chart
multi-verse
lit-element components for fast and modular multivariate analysis
Stars: ✭ 34 (-24.44%)
Mutual labels:  chart, dataviz
awesome-tools
Open-source list of awesome data visualization tools (e.g., charting libraries) for software developers 📊📈
Stars: ✭ 47 (+4.44%)
Mutual labels:  chart, dataviz
Rumble Charts
React components for building composable and flexible charts
Stars: ✭ 293 (+551.11%)
Mutual labels:  svg, chart
awesome-dataviz
📈 A curated list of awesome data visualization libraries and resources.
Stars: ✭ 3,153 (+6906.67%)
Mutual labels:  chart, dataviz
React D3 Tree
🌳 React component to create interactive D3 tree graphs
Stars: ✭ 543 (+1106.67%)
Mutual labels:  svg, chart
Ngx Graph
Graph visualization library for angular
Stars: ✭ 704 (+1464.44%)
Mutual labels:  svg, chart
Jquery Mapael
jQuery plugin based on raphael.js that allows you to display dynamic vector maps
Stars: ✭ 981 (+2080%)
Mutual labels:  svg, dataviz
Charts
Simple, responsive, modern SVG Charts with zero dependencies
Stars: ✭ 14,112 (+31260%)
Mutual labels:  svg, chart
Laue
🖖📈 Modern charts for Vue 2.0
Stars: ✭ 245 (+444.44%)
Mutual labels:  svg, chart

svg-radar-chart

Generate SVG radar charts.

an example

npm version build status dependency status dev dependency status ISC-licensed chat on gitter support me on Patreon

This library is inspired by radar-chart-d3 but tries to do a few things differently:

  • svg-radar-chart does not limit you in which frontend stack you use. It just returns virtual-dom nodes.
  • Because radar-chart-d3 includes D3, it weighs 212k. svg-radar-chart weighs 9k.
  • Because angular-radial-plot includes includes D3, it weighs roughly 160k. svg-radar-chart weighs 9k.

Note: This library is an opinionated tool; I maintain it with my personal use cases in mind. I do'nt intend to cover every feature a radar chart library might possibly need.

Installing

npm install svg-radar-chart

Usage

const radar = require('svg-radar-chart')

const chart = radar({
	// columns
	battery: 'Battery Capacity',
	design: 'Design',
	useful: 'Usefulness'
}, [
	// data
	{class: 'iphone', battery: .7, design:  1, useful: .9},
	{class: 'galaxy', battery:  1, design: .6, useful: .8},
	{class: 'nexus',  battery: .8, design: .7, useful: .6}
])

svg-radar-chart returns virtual-dom, so you can decide what to do with it.

To generate an SVG string from it, use virtual-dom-stringify:

const stringify = require('virtual-dom-stringify')

const svg = `
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
	<style>
		.axis {
			stroke-width: .2;
		}
		.scale {
			stroke-width: .2;
		}
		.shape {
			fill-opacity: .3;
		}
		.shape:hover {
			fill-opacity: .6;
		}
	</style>
	${stringify(chart)}
</svg>
`

You may now create an SVG file using Node.js:

process.stdout.write(svg)
node generate-chart.js >chart.svg

Or insert it into the DOM:

document.querySelector('#my-chart').innerHTML = svg

Check the website or the example on how to customize charts further.

Smoothing

You can pass the cardinal-closed smoothing function as follows, but it will add another 18k to your bundle, if you use common-shakeify, otherwise a bit more.

const smoothing = require('svg-radar-chart/smoothing')
radar(columns, data, {
	smoothing: smoothing(.3) // tension of .3
})

API

radar(columns, data, [opt])

columns must be an object. The values are captions.

data must be an array of data points. The keys in one data points must exist in columns.

opt is optional and has the following default values:

const defaults = {
	size: 100, // size of the chart (including captions)
	axes: true, // show axes?
	scales: 3, // show scale circles?
	captions: true, // show captions?
	captionsPosition: 1.2, // where on the axes are the captions?
	smoothing: noSmoothing, // shape smoothing function
	axisProps: () => ({className: 'axis'}),
	scaleProps: () => ({className: 'scale', fill: 'none'}),
	shapeProps: () => ({className: 'shape'}),
	captionProps: () => ({
		className: 'caption',
		textAnchor: 'middle', fontSize: 3,
		fontFamily: 'sans-serif'
	})
}

smoothing(points) must return valid SVG <path> commands.

See also

  • svg-patterns – Create SVG patterns programmatically to visualize data.
  • svg-world-map – Render a world map with a pin at a specific location.

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

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].