Skip to content

Commit

Permalink
Bug: fix rect box tree node placement (#189 #199)
Browse files Browse the repository at this point in the history
* Id and label added for body

* Code smells

* Code smells

* When tree width changed the box is properly generated

Co-authored-by: Vutukuri Sai Ajay <[email protected]>
Co-authored-by: Bruce W. Herr II <[email protected]>
  • Loading branch information
3 people authored Jul 22, 2021
1 parent 023bd1f commit 3da425c
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions projects/v2/src/app/modules/tree/spec/groups/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export class TreeMarkGroup implements VegaTreeMarkGroup {
stroke: {value: 'steelblue'}
},
update: {
x: {field: 'bounds.x1', round: true, offset: {signal: '-bgoffset'}},
x2: {field: 'bounds.x2', round: true, offset: {signal: 'bgoffset'}},
y: {field: 'bounds.y1', round: true, offset: {signal: '-bgoffset'}},
y2: {field: 'bounds.y2', round: true, offset: {signal: 'bgoffset'}},
fill: {value: 'aliceblue'},
stroke: {value: 'steelblue'},
opacity: [
{
test: 'node__click === null && indata(\'search\', \'id\', datum.datum.id)',
Expand Down Expand Up @@ -92,6 +98,13 @@ export class TreeMarkGroup implements VegaTreeMarkGroup {
zindex: {value: -1}
},
update: {
x: { field: 'bounds.x1', round: true, offset: { signal: '-bgoffset' } },
x2: { field: 'bounds.x2', round: true, offset: { signal: 'bgoffset' } },
y: { field: 'bounds.y1', round: true, offset: { signal: '-bgoffset' } },
y2: { field: 'bounds.y2', round: true, offset: { signal: 'bgoffset' } },
fill: { value: 'lightblue' },
stroke: { value: 'darkblue' },
zindex: {value: -1},
opacity: [
{
test: 'node__click === null && indata(\'discrepencyLabel\', \'id\', datum.datum.id)',
Expand Down Expand Up @@ -125,6 +138,13 @@ export class TreeMarkGroup implements VegaTreeMarkGroup {
zindex: {value: -1}
},
update: {
x: { field: 'bounds.x1', round: true, offset: { signal: '-bgoffset' } },
x2: { field: 'bounds.x2', round: true, offset: { signal: 'bgoffset' } },
y: { field: 'bounds.y1', round: true, offset: { signal: '-bgoffset' } },
y2: { field: 'bounds.y2', round: true, offset: { signal: 'bgoffset' } },
fill: { value: 'lightblue' },
stroke: { value: 'darkblue' },
zindex: {value: -1},
opacity: [
{
test: 'node__click === null && indata(\'discrepencyId\', \'id\', datum.datum.id)',
Expand All @@ -140,8 +160,8 @@ export class TreeMarkGroup implements VegaTreeMarkGroup {
}

/**
* Rectangle around the bimodal text mark when duplicate Id toggle is turned on
*/
* Rectangle around the bimodal text mark when duplicate Id toggle is turned on
*/
makeBimodalTextDuplicateIdMarks() {
return {
name: 'rectmarkduplicateid',
Expand All @@ -158,6 +178,13 @@ export class TreeMarkGroup implements VegaTreeMarkGroup {
zindex: {value: -1}
},
update: {
x: { field: 'bounds.x1', round: true, offset: { signal: '-bgoffset' } },
x2: { field: 'bounds.x2', round: true, offset: { signal: 'bgoffset' } },
y: { field: 'bounds.y1', round: true, offset: { signal: '-bgoffset' } },
y2: { field: 'bounds.y2', round: true, offset: { signal: 'bgoffset' } },
fill: { value: 'lightblue' },
stroke: { value: 'darkblue' },
zindex: {value: -1},
opacity: [
{
test: 'node__click === null && indata(\'duplicateId\', \'id\', datum.datum.id)',
Expand Down

0 comments on commit 3da425c

Please sign in to comment.