langfordg / react-chord-diagram Goto Github PK
View Code? Open in Web Editor NEWA React component for building D3 Chord Diagrams
Home Page: https://langfordG.github.io/react-chord-diagram/
License: MIT License
A React component for building D3 Chord Diagrams
Home Page: https://langfordG.github.io/react-chord-diagram/
License: MIT License
Looks like https://langfordg.github.io/react-chord-diagram/ is broken; examples don't render
Hi! I was trying to fit the chart in my template because of the labels was overflowing the container and get cropped. So I try to set the outerRadius
prop and the chart gets a little small like I want but the Labels get hide.
import React, { useState } from "react";
import "./styles.css";
import ChordDiagram from "react-chord-diagram";
export default function App() {
const [state, setState] = useState([
[0, 9, 14, 16, 24, 18, 7, 21, 7, 6],
[12, 0, 17, 16, 13, 23, 4, 16, 10, 8],
[6, 13, 0, 6, 1, 8, 5, 8, 10, 14],
[30, 15, 3, 0, 32, 13, 3, 53, 6, 8],
[38, 28, 17, 54, 0, 27, 50, 138, 3, 4],
[10, 7, 10, 13, 8, 0, 4, 8, 9, 8],
[13, 12, 11, 16, 21, 23, 0, 31, 7, 8],
[43, 22, 10, 45, 105, 47, 56, 0, 3, 8],
[2, 3, 0, 0, 0, 0, 0, 0, 0, 6],
[0, 0, 0, 2, 0, 0, 0, 0, 3, 0]
]);
return (
<div className="App">
<ChordDiagram
className="chartDiagram"
matrix={state}
componentId={1}
groupLabels={[
"Ignizione ON",
"Movimento ON",
"Movimento OFF",
"LBL1",
"LBL2",
"Tagliando1",
"Tagliando2",
"Tagliando3",
"Tagliando4",
"Tagliando5"
]}
groupColors={[
"#2255A4",
"#006629",
"#15295E",
"#790D1A",
"#FFE000",
"#060606",
"#0F793B",
"#15295E",
"#B40224",
"#13803F"
]}
disableRibbonHover={false}
disableGroupHover={false}
outerRadius="150"
innerRadius="140"
blurOnHover={true}
ribbonOpacity=".9"
ribbonBlurOpacity="0.2"
style={{
fontFamily: "Sans serif",
fontSize: "12px",
color: "#333"
}}
/>
</div>
);
}
Am I doing something wrong or there is any solution for this?
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.