-
Notifications
You must be signed in to change notification settings - Fork 623
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
Repeat #1262
Repeat #1262
Changes from 13 commits
c831d9f
bde7cf5
d87b7a2
9faa012
47cb5a8
b8062d8
0f5a883
f10b35f
7fa1bb5
bc0d151
0ff55a4
36291ee
703a642
b8e488b
5975cce
018f662
b83cab8
42c7b7a
c0bd61f
3316418
2858105
9b24ea6
a80ba40
0ea89da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"version": "0.1.0", | ||
"command": "npm", | ||
"isShellCommand": true, | ||
"args": [ | ||
"run" | ||
], | ||
"showOutput": "silent", | ||
"tasks": [ | ||
{ | ||
// "npm run build" | ||
"taskName": "build", | ||
"isBuildCommand": true, | ||
"problemMatcher": "$tsc" | ||
}, | ||
{ | ||
// Test task, Ctrl+Shift+T | ||
// "npm test" | ||
"taskName": "test", | ||
"isTestCommand": true | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,11 @@ import {Formula} from '../../transform'; | |
import {keys, Dict, StringSet} from '../../util'; | ||
import {VgData, VgTransform} from '../../vega.schema'; | ||
|
||
import {FacetModel} from './../facet'; | ||
import {LayerModel} from './../layer'; | ||
import {Model} from './../model'; | ||
import {UnitModel} from './../unit'; | ||
import {FacetModel} from '../facet'; | ||
import {RepeatModel} from '../repeat'; | ||
import {LayerModel} from '../layer'; | ||
import {Model} from '../model'; | ||
import {UnitModel} from '../unit'; | ||
|
||
import {source} from './source'; | ||
import {formatParse} from './formatparse'; | ||
|
@@ -83,8 +84,8 @@ export function parseUnitData(model: UnitModel): DataComponent { | |
return { | ||
formatParse: formatParse.parseUnit(model), | ||
nullFilter: nullFilter.parseUnit(model), | ||
filter: filter.parseUnit(model), | ||
nonPositiveFilter: nonPositiveFilter.parseUnit(model), | ||
filter: filter.parseUnit(model), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you swapping the order here? (Just curious why?) |
||
|
||
source: source.parseUnit(model), | ||
bin: bin.parseUnit(model), | ||
|
@@ -101,8 +102,8 @@ export function parseFacetData(model: FacetModel): DataComponent { | |
return { | ||
formatParse: formatParse.parseFacet(model), | ||
nullFilter: nullFilter.parseFacet(model), | ||
filter: filter.parseFacet(model), | ||
nonPositiveFilter: nonPositiveFilter.parseFacet(model), | ||
filter: filter.parseFacet(model), | ||
|
||
source: source.parseFacet(model), | ||
bin: bin.parseFacet(model), | ||
|
@@ -119,10 +120,10 @@ export function parseLayerData(model: LayerModel): DataComponent { | |
return { | ||
// filter and formatParse could cause us to not be able to merge into parent | ||
// so let's parse them first | ||
filter: filter.parseLayer(model), | ||
formatParse: formatParse.parseLayer(model), | ||
nullFilter: nullFilter.parseLayer(model), | ||
nonPositiveFilter: nonPositiveFilter.parseLayer(model), | ||
filter: filter.parseLayer(model), | ||
|
||
// everything after here does not affect whether we can merge child data into parent or not | ||
source: source.parseLayer(model), | ||
|
@@ -136,6 +137,24 @@ export function parseLayerData(model: LayerModel): DataComponent { | |
}; | ||
} | ||
|
||
export function parseRepeatData(model: RepeatModel): DataComponent { | ||
return { | ||
formatParse: formatParse.parseRepeat(model), | ||
nullFilter: nullFilter.parseRepeat(model), | ||
nonPositiveFilter: nonPositiveFilter.parseRepeat(model), | ||
filter: filter.parseRepeat(model), | ||
|
||
source: source.parseRepeat(model), | ||
bin: bin.parseRepeat(model), | ||
calculate: formula.parseRepeat(model), | ||
timeUnit: timeUnit.parseRepeat(model), | ||
timeUnitDomain: timeUnitDomain.parseRepeat(model), | ||
summary: summary.parseRepeat(model), | ||
stackScale: stackScale.parseRepeat(model), | ||
colorRank: colorRank.parseRepeat(model) | ||
}; | ||
} | ||
|
||
|
||
/* tslint:enable:no-use-before-declare */ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import {FacetModel} from './../facet'; | ||
import {LayerModel} from './../layer'; | ||
import {Model} from './../model'; | ||
import {FacetModel} from '../facet'; | ||
import {LayerModel} from '../layer'; | ||
import {RepeatModel} from '../repeat'; | ||
import {Model} from '../model'; | ||
|
||
import {DataComponent} from './data'; | ||
|
||
|
@@ -41,11 +42,23 @@ export namespace filter { | |
return filterComponent; | ||
} | ||
|
||
export function parseRepeat(model: RepeatModel) { | ||
// Note that this `filter.parseLayer` method is called before `source.parseLayer` | ||
let filterComponent = parse(model); | ||
model.children().forEach((child) => { | ||
const childDataComponent = child.component.data; | ||
if (childDataComponent.filter) { | ||
delete childDataComponent.filter; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why always delete without even merging? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 018f662 |
||
} | ||
}); | ||
return filterComponent; | ||
} | ||
|
||
export function assemble(component: DataComponent) { | ||
const filter = component.filter; | ||
return filter ? [{ | ||
type: 'filter', | ||
test: filter | ||
}] : []; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. JSON shouldn't have JS comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domoritz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix in on master