sheshbabu / react-frappe-charts Goto Github PK
View Code? Open in Web Editor NEWLightweight React Charts
Home Page: https://react-frappe-charts.netlify.com
Lightweight React Charts
Home Page: https://react-frappe-charts.netlify.com
I think typing don't support Heatmap chart.
Following frappe documentation we have to pass data using dataPoints
instead of labels
and values
.
let data = {
dataPoints: {
"1426744959": 20,
"1463673055": 113,
"1476892421": 57,
// ...
},
start: startDate, // a JS date object
end: endDate
}
There are 2 issues for using heatmap:
dataset
and values
properties are required, but for heatmap chart they are not. Issue would be solved by making both attributes optional.Current library declares dataPoints type as follows:
dataPoints?: {
["string"]: number;
};
This compilation error will be fixed using following syntax:
dataPoints?: {
[x: string]: number;
};
Hi. I imported react-frappe-charts
in my app created with Create React App. It works fine but when I try to run any unit tests I get an error
● Test suite failed to run
/node_modules/react-frappe-charts/build/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import React from "react";
^^^^^^
SyntaxError: Cannot use import statement outside a module
I believe this is because the library is using ES6 modules in production. Would you consider transpiling the code before publishing to npm?
Meanwhile, Can anyone think of a workaround so that I can run my tests?
As a library which strongly depends on Frappe, I would suggest specifying frappe-charts
as a peer dependency to let developers have finer control over its version.
When I tried to embed the sample pie chart code provided in the project page into my React page component, the page would render for a split second, then crash with the following error stack (note that when using the other chart type like 'line', 'bar', it works fine, it only crashes when I switched to pie type), any idea what could cause this error?
Uncaught TypeError: Cannot read property 'replaceChild' of null
eval | @ | frappe-charts.min.esm.js?4215:1 | |
---|---|---|---|
animateSVG | @ | frappe-charts.min.esm.js?4215:1 | |
runSMILAnimation | @ | frappe-charts.min.esm.js?4215:1 | |
value | @ | frappe-charts.min.esm.js?4215:1 | |
value | @ | frappe-charts.min.esm.js?4215:1 | |
eval | @ | frappe-charts.min.esm.js?4215:1 | |
setTimeout (async) | |||
value | @ | frappe-charts.min.esm.js?4215:1 | |
value | @ | frappe-charts.min.esm.js?4215:1 | |
e | @ | frappe-charts.min.esm.js?4215:1 | |
getChartByType | @ | frappe-charts.min.esm.js?4215:1 | |
t | @ | frappe-charts.min.esm.js?4215:1 | |
eval | @ | index.js?8485:8 | |
commitHookEffectList | @ | react-dom.development.js?61bb:22030 | |
commitPassiveHookEffects | @ | react-dom.development.js?61bb:22064 | |
callCallback | @ | react-dom.development.js?61bb:336 | |
invokeGuardedCallbackDev | @ | react-dom.development.js?61bb:385 | |
invokeGuardedCallback | @ | react-dom.development.js?61bb:440 | |
flushPassiveEffectsImpl | @ | react-dom.development.js?61bb:25392 | |
unstable_runWithPriority | @ | scheduler.development.js?3069:697 | |
runWithPriority$2 | @ | react-dom.development.js?61bb:12149 | |
flushPassiveEffects | @ | react-dom.development.js?61bb:25361 | |
performSyncWorkOnRoot | @ | react-dom.development.js?61bb:24251 | |
eval | @ | react-dom.development.js?61bb:12199 | |
unstable_runWithPriority | @ | scheduler.development.js?3069:697 | |
runWithPriority$2 | @ | react-dom.development.js?61bb:12149 | |
flushSyncCallbackQueueImpl | @ | react-dom.development.js?61bb:12194 | |
flushSyncCallbackQueue | @ | react-dom.development.js?61bb:12182 | |
unbatchedUpdates | @ | react-dom.development.js?61bb:24439 | |
legacyRenderSubtreeIntoContainer | @ | react-dom.development.js?61bb:27527 | |
render | @ | react-dom.development.js?61bb:27608 | |
eval | @ | index.jsx?ed12:21 | |
./src/index.jsx | @ | bundle.js:10803 | |
webpack_require | @ | bundle.js:20 | |
0 | @ | bundle.js:10852 | |
webpack_require | @ | bundle.js:20 | |
(anonymous) | @ | bundle.js:84 | |
(anonymous) | @ | bundle.js:87 |
Frappe charts supports disabling the chart animation via the animate
option.
Can we get support for this as a parameter?
I can see that the y-axis changes depending on the values inserted. If the values started with 10, then, the y-axis starts in 10 and not for example in 0.
Would it be possible to add an option to always use a min and a max that would be on display?
Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
Please fix this issue!, or help me fix it!
Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. Related #20
diff --git a/node_modules/react-frappe-charts/build/index.js b/node_modules/react-frappe-charts/build/index.js
index 6b82382..0df800e 100644
--- a/node_modules/react-frappe-charts/build/index.js
+++ b/node_modules/react-frappe-charts/build/index.js
@@ -20,6 +20,7 @@ const ReactFrappeChart = forwardRef((props, parentRef) => {
onDataSelect(e);
});
}
+ return () => chart.current.destroy();
}, []);
React.useEffect(() => {
if (initialRender.current) {
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.