arpitnarechania / d3-dotmatrix Goto Github PK
View Code? Open in Web Editor NEWOpen Source Javascript library to render Dot Matrix Charts
License: MIT License
Open Source Javascript library to render Dot Matrix Charts
License: MIT License
I can't draw anything using the readme.md,I found some bugs.
To use this library then, simply include d3.js, DotMatrix.js and DotMatrix.css:
<script src="/path/to/d3.min.js"></script> <script src="/path/to/dist/DotMatrix.css"></script> <script src="/path/to/dist/DotMatrix.js"></script>
1.I don't think the css file can be import in this way,right?
To use this library, you must create a container element and instantiate a new DotMatrixChart:
2.The ID is wrong.I read codes,is shoule be "DotMatrixChart".
It is my fist time use "issues" in github, and my English is not very good,Im sorry if I make some mistakes.
hi, can you please update to resize, and also how can I setup up different colors, even a gradient using a scale of 1 to 10 or groups.
Trains - red
People - blue
people in trains blue/red
Hi! First, thank you for developing this dot-matrix D3 application.
Premise: I am quite new to D3 and frontend frameworks. I need to use this code inside a React component. Could you help me figure how this works?
Here's my current jsx component's code :
import React, {Component} from 'react';
import * as d3 from "d3";
import '../../public/assets/DotMatrix';
import '../../public/assets/DotMatrix.css';
class DotMatrixChart extends Component {
componentDidMount() {
this.drawChart();
}
drawChart() {
//const data = this.props.data;
const svg = d3.select("#dotMatrix").append("svg")
.attr("width", this.props.width)
.attr("height", this.props.height);
var dataset =[
{ group: "Group 1" ,category: "Category 1", count: 48},
{ group: "Group 1" ,category: "Category 2", count: 27},
{ group: "Group 1" ,category: "Category 3", count: 12},
{ group: "Group 1" ,category: "Category 4", count: 16},
{ group: "Group 2" ,category: "Category 1", count: 35},
{ group: "Group 2" ,category: "Category 2", count: 12},
{ group: "Group 2" ,category: "Category 3", count: 16},
{ group: "Group 2" ,category: "Category 4", count: 42},
{ group: "Group 3" ,category: "Category 1", count: 39},
{ group: "Group 3" ,category: "Category 2", count: 25},
{ group: "Group 3" ,category: "Category 3", count: 26},
{ group: "Group 3" ,category: "Category 4", count: 46},
];
var chart_options = {
dot_radius : 5,
no_of_circles_in_a_row: 40,
dot_padding_left : 5,
dot_padding_right : 5,
dot_padding_top : 5,
dot_padding_bottom : 5
}
DotMatrixChart(dataset, chart_options);
}
render() {
return <div id={"#" + this.props.id}></div>
}
}
export default DotMatrixChart;
On my App.js, I have wrapped the component into a <div id="dotMatrix"></div>
I receive the following errors from console:
Please if you can, let me know what I am doing wrong. Thank you very much in advance ๐๐ผ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.