Renames class and react function
This commit is contained in:
parent
a480995139
commit
e77b1c2e60
|
@ -11,10 +11,7 @@ function exists(arr) {
|
||||||
return arr.find(num => _.isFinite(num));
|
return arr.find(num => _.isFinite(num));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export class DistPlotD3 {
|
||||||
* @todo: To rename as "DistPlotD3".
|
|
||||||
*/
|
|
||||||
export class CdfChartD3 {
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.attrs = {
|
this.attrs = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { useSize } from 'react-use';
|
import { useSize } from 'react-use';
|
||||||
import { CdfChartD3 } from './distPlotD3';
|
import { DistPlotD3 } from './distPlotD3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param min
|
* @param min
|
||||||
|
@ -14,12 +14,11 @@ function getRandomInt(min, max) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo: To rename as "DistPlotReact".
|
|
||||||
* @param props
|
* @param props
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function CdfChartReact(props) {
|
function DistPlotReact(props) {
|
||||||
const containerRef = React.createRef();
|
const containerRef = React.createRef();
|
||||||
const key = "cdf-chart-react-" + getRandomInt(0, 1000);
|
const key = "cdf-chart-react-" + getRandomInt(0, 1000);
|
||||||
const scale = props.scale || 'linear';
|
const scale = props.scale || 'linear';
|
||||||
|
@ -35,7 +34,7 @@ function CdfChartReact(props) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
new CdfChartD3()
|
new DistPlotD3()
|
||||||
.set('svgWidth', width)
|
.set('svgWidth', width)
|
||||||
.set('svgHeight', props.height)
|
.set('svgHeight', props.height)
|
||||||
.set('maxX', props.maxX)
|
.set('maxX', props.maxX)
|
||||||
|
@ -79,4 +78,4 @@ function CdfChartReact(props) {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CdfChartReact;
|
export default DistPlotReact;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user