accurat / react-composable-charts Goto Github PK
View Code? Open in Web Editor NEWA React library to build charts
Home Page: https://react-composable-charts.netlify.app
License: MIT License
A React library to build charts
Home Page: https://react-composable-charts.netlify.app
License: MIT License
<element.text
x={xPos}
y={yPos}
fill={DEFAULT_BLUE}
fontSize={14}
contentScriptType={selectedItem?.label}
// @ts-expect-error
text={selectedItem?.label}
/>
fix text attribute in element.text
const animationEnterProp = {
y: (_: BarchartCountriesDataset[number], index: number, nodes: SVGTextElement[]) => {
const selectedNode = nodes[index]
const y = selectedNode.getAttribute('y')
return y
}
}
<BarData
data={countriesRanking}
dataKey={(d) => d.countryIso3}
y={(d) => d.countryIso3}
x={{ to: () => xDomain[0], base: () => xDomain[1] }}
fill={'#F1F2F5'}
enter={animationEnterProp}
opacity={1}
/>
Dare la possibilità di passare una funzione all'attributo enter
Add to the BarData component the event prop. Hence it can handle js events.
Description:
Tooltip is a functional component used to display tooltip content at a specified position relative to its target.
Props:
x: X-coordinate position of the tooltip.
y: Y-coordinate position of the tooltip.
children (optional): The content to be displayed within the tooltip.
style (optional): Additional CSS styles for the tooltip.
horizontalAnchor (optional): Horizontal anchor position of the tooltip: 'start' | 'center' | 'end'. Default is 'center'.
verticalAnchor (optional): Vertical anchor position of the tooltip: 'start' | 'center' | 'end'. Default is 'center'.
horizontalSpacing (optional): Horizontal spacing between the tooltip and its target.
verticalSpacing (optional): Vertical spacing between the tooltip and its target.
Example:
<Tooltip
x={100}
y={100}
horizontalAnchor="start"
verticalAnchor="end"
horizontalSpacing={10}
verticalSpacing={5}
>
{/* Tooltip content */}
</Tooltip>
It would be useful we can import this type from src/lib/stack.ts
type Stack<T> = {
datum: T
to: number
base: number
group: string
category: string | number
value: number
}
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.