Comments (3)
@yuniwahuni in order to better help you with debugging, could you make a simple repro example on https://codepen.io/ ?
from timelines-chart.
@yuniwahuni in order to better help you with debugging, could you make a simple repro example on https://codepen.io/ ?
@vasturiano
Sure, thanks for your reply on my question,
I will make source for codepen. please wait a moment.
Up to now, the cause that i think is Asynchronous responce of backend.
I used Apollo graphql bewteen backend and frontend for API.
If I don't use backend, the error is not happen. but when I use backend and get data asynchronous, it happen somtimes.
import { useEffect, useState } from 'react';
import { GET_TIME_LINE_LIST } from './api/gql/devConf';
import { useQuery } from '@apollo/client';
import Timelines from './Timelines';
import moment from 'moment';
import Tabs from './component/Tab';
function makePeriodFromDaylist(group, dates) {
//... make date period from data
}
function configRangeData(group, orderRecord) {
//.. make data for timelinechart
return [
{
label: '',
data: makePeriodFromDaylist(group, orderDayList),
},
];
}
function makeGroupData(data) {
const uniqueOrderName = [...new Set(data.map((item) => item.orderName))];
const resultData = uniqueOrderName.map((orderName) => ({
group: orderName,
data: configRangeData(
orderName,
data.filter((v) => v.orderName === orderName)
),
}));
return resultData;
}
export default function App() {
const [category, setCategory] = useState({ categoryKey: 3, categoryName: 'medicine' });
const { loading, error, data } = useQuery(GET_TIME_LINE_LIST, {
fetchPolicy: 'network-only',
variables: {
chartNo: '00-0000001',
category: category.categoryKey,
inDate: '',
},
});
function makeCategoryTab(categoryList) {
function onSetCategory(cat) {
setCategory(cat);
}
return <Tabs data={categoryList} category={category} onSetCategory={onSetCategory} />;
}
if (loading) return <>{'Loading...'}</>;
if (error) return <>{'Error ${error.message'}}</>;
if (data) {
const timelineList = data?.getTimelineList?.timelineList;
if (timelineList.length > 0) {
return (
<>
<div className='Tabs'>
<span className='TitleCaption'>{'Medicine TimeLine'}</span>
<ul className='nav'>{makeCategoryTab()}</ul>
</div>
<Timelines data={makeGroupData(timelineList)} />
</>
);
} else {
return <></>;
}
}
return <></>;
}
from timelines-chart.
Hi! Thank you for opening this issue. I have the same error using timelines-chart with vue.js, while refreshing too quickly.
from timelines-chart.
Related Issues (20)
- Duplicate labels HOT 1
- How to do Multiple Selection of Timeline Segments using Cursor Drag (click+Drag) and Handling the selection of those segments to store the info and update their UI based on our logic
- some entries appear in wrong group row HOT 2
- Feature Request for SortChrono
- Custom Tooltip with custom value. HOT 1
- Feature Request: onChartRendered
- How to use enableOverview() HOT 1
- Custom messages - changed from 2.11.5 to 2.11.8? HOT 1
- onScaleUnitClick HOT 2
- Series segments not being created on firefox HOT 3
- Coloring individual (overlapping) segments HOT 2
- "Fill" option for chart sizing HOT 1
- Set the timeline height HOT 2
- Text on Segments
- Line datetime from zero
- Blue tooltips do not disappear
- User defined group label width
- Mark the weekends on the chart
- Resizing and moving blocks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timelines-chart.