React/Victory: Graph not showing entries

React/Victory: Graph not showing entries



I am working on fitting my data to this Victory graph but for some reason it is not coming out like expected. I don't need a y-axis but on the x-axis I am trying to list the entries in my dataset from earliest to latest. The component seems to be receiving data but the graph does not render as expected. The example is here, https://formidable.com/open-source/victory/guides/zoom-large-data/



Component


class CustomChart extends React.Component
constructor(props)
super();
this.entireDomain = this.getEntireDomain(props);
this.state =
zoomedXDomain: this.entireDomain.x,
;

onDomainChange(domain)
this.setState(
zoomedXDomain: domain.x,
);

getData()
const zoomedXDomain = this.state;
const data, maxPoints = this.props;
const filtered = data.action.filter(
(action) => (action.timestamp >= zoomedXDomain[0] && action.timestamp <= zoomedXDomain[1]));

if (filtered.length > maxPoints )
const k = Math.ceil(filtered.length / maxPoints);
return filtered.filter(
(d, i) => ((i % k) === 0)
);

return filtered;

getEntireDomain(props)
const data = props;
return
y: [_.minBy(data.action, action => action.timestamp).timestamp, _.maxBy(data.action, action => action.timestamp).timestamp],
x: [ data.action[0].timestamp, _.last(data.action).timestamp ]
;

getZoomFactor()
const zoomedXDomain = this.state;
const factor = 10 / (zoomedXDomain[1] - zoomedXDomain[0]);
return _.round(factor, factor < 3 ? 1 : 0);

render()
const renderedData = this.getData();
return (
<div>
<VictoryChart
domain=this.entireDomain
containerComponent=<VictoryZoomContainer
zoomDimension="x"
onZoomDomainChange=this.onDomainChange.bind(this)
minimumZoom=x: 1/10000
/>
>
<VictoryScatter data=renderedData />
</VictoryChart>
<div>
this.getZoomFactor()x zoom;
rendering renderedData.length of this.props.data.length
</div>
</div>
);

//render


//component


export default graphql(getObjectsQuery,
options: (ownProps) =>
console.log('CustomChart getObjectsQuery:', ownProps.startTime);
return ( second: startTime: ownProps.startTime,
endTime: ownProps.endTime

)

)(CustomChart);



Data
enter image description here






Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Some of your past answers have not been well-received, and you're in danger of being blocked from answering.



Please pay close attention to the following guidance:



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế