Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected time series fill result on a merged time series #121

Open
katrotz opened this issue Jun 29, 2018 · 1 comment
Open

Unexpected time series fill result on a merged time series #121

katrotz opened this issue Jun 29, 2018 · 1 comment

Comments

@katrotz
Copy link

katrotz commented Jun 29, 2018

When executing the fill operation on a timeSeries that is the result of the TimeSeries.timeSeriesListMerge, the fill seems not to work.

// Input time series 1
var ts1 = new TimeSeries({
        name: 'telemetry',
	columns: [ 'time', 'pressure' ],
        points: [
             [ 1530226800000, 1 ] 
        ]
});
// Input time series 2
var ts2 = new TimeSeries({
	name: 'telemetry',
	columns: [ 'time', 'temperature' ],
        points: [
            [ 1530226800000, 10], 
            [ 1530226800001, 11 ]
        ]
});
// Time series that combines ts1 and ts2 MANUALLY created
var tsCombined = new TimeSeries({
	name: 'telemetry',
	columns: [ 'time', 'pressure',  'temperature' ],
        points: [
    	    [ 1530226800000, 1, 10 ],
    	    [ 1530226800001, undefined, 11 ]
        ]
});
// Time series that combines ts1 and ts2 MERGE created
var tsMerge = TimeSeries.timeSeriesListMerge({
	name: 'telemetry',
	seriesList: [ ts1, ts2 ]
});
// Fill the combines MANUAL time series
var tsCombinedFill = tsCombined.fill({
	fieldSpec: [ 'pressure', 'temperature' ],
	method: 'pad'
});
// Fill the combined MERGE time series
var tsMergeFill = tsMerge.fill({
	fieldSpec: [ 'pressure', 'temperature' ],
	method: 'pad'
});

Expecting that the merged time series to render same results as the manually combines time series
Actually it is not filling the gaps:

tsCombinedFill.toString()
// "{"name":"telemetry","utc":true,"columns":["time","pressure","temperature"],"points":[[1530226800000,1,10],[1530226800001,1,11]]}"
tsMergeFill.toString()
// "{"name":"telemetry","utc":true,"columns":["time","pressure","temperature"],"points":[[1530226800000,1,10],[1530226800001,null,11]]}"
@katrotz
Copy link
Author

katrotz commented Jun 29, 2018

Please note that creating a new time series from a merged time series will correctly fill the gaps:

(new TimeSeries(tsMerge.toJSON())).fill({
	fieldSpec: [ 'pressure', 'temperature' ],
	method: 'pad'
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant