Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit 0bbd680

Browse files
authored
Merge pull request #153 from jimbojw/wit
updating stroke colors and styles.
2 parents 3d7ac5f + c12c1e5 commit 0bbd680

File tree

2 files changed

+50
-48
lines changed

2 files changed

+50
-48
lines changed

facets_dive/components/facets_dive/facets-dive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
flex-direction: column;
5656
}
5757
facets-dive-controls {
58-
border-bottom: 1px solid black;
58+
border-bottom: 1px solid #d3d3d3;
5959
flex-grow: 0;
6060
flex-shrink: 0;
6161
height: 60px;

facets_dive/components/facets_dive_vis/facets-dive-vis.ts

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const SELECTED_ITEM_COLOR = '#fad411';
7070
/**
7171
* Color for stroke around selected item borders.
7272
*/
73-
const SELECTED_ITEM_COLOR_STROKE = '#826e09';
73+
const SELECTED_ITEM_COLOR_STROKE = '#483d06';
7474

7575
/**
7676
* Stroke width for the selected item borders.
@@ -90,12 +90,12 @@ const SELECTED_ITEM_FINAL_SCALE = 0.8;
9090
/**
9191
* Color for compared item borders.
9292
*/
93-
const COMPARED_ITEM_COLOR = '#16dcfb';
93+
const COMPARED_ITEM_COLOR = '#1d6b1d';
9494

9595
/**
9696
* Color for stroke around compared item borders.
9797
*/
98-
const COMPARED_ITEM_COLOR_STROKE = '#0b6371';
98+
const COMPARED_ITEM_COLOR_STROKE = '#44ff44';
9999

100100
/**
101101
* Stroke width for the compared item borders.
@@ -1034,19 +1034,20 @@ class FacetsDiveVizInternal {
10341034
this.selectedLayer.selectAll('.selected').data(selectedBoxes);
10351035

10361036
// ENTER.
1037-
const enterElements = selectedElements
1038-
.enter()
1039-
.append('g')
1040-
.classed('selected', true)
1041-
.attr('transform', (pos: ItemPosition) => {
1042-
const x = 0.5 + (pos.x || 0);
1043-
const y = 0.5 + (pos.y || 0);
1044-
return `translate(${x},${y}) scale(${SELECTED_ITEM_INITIAL_SCALE})`;
1045-
})
1046-
.style('opacity', 0);
1047-
1048-
enterElements
1049-
.append('rect')
1037+
const enterElements = selectedElements.enter()
1038+
.append('g')
1039+
.classed('selected', true)
1040+
.attr(
1041+
'transform',
1042+
(pos: ItemPosition) => {
1043+
const x = 0.5 + (pos.x || 0);
1044+
const y = 0.5 + (pos.y || 0);
1045+
return `translate(${x},${y}) scale(${
1046+
SELECTED_ITEM_INITIAL_SCALE})`;
1047+
})
1048+
.style('opacity', 0);
1049+
1050+
enterElements.append('rect')
10501051
.attr('x', -0.5)
10511052
.attr('y', -0.5)
10521053
.attr('width', 1)
@@ -1057,8 +1058,7 @@ class FacetsDiveVizInternal {
10571058
.attr('stroke-opacity', 0)
10581059
.attr('stroke-width', SELECTED_ITEM_STROKE_WIDTH * 2)
10591060
.attr('fill-opacity', 0);
1060-
enterElements
1061-
.append('rect')
1061+
enterElements.append('rect')
10621062
.attr('x', -0.5)
10631063
.attr('y', -0.5)
10641064
.attr('width', 1)
@@ -1073,14 +1073,15 @@ class FacetsDiveVizInternal {
10731073
// ENTER + UPDATE.
10741074
const mergedElements = enterElements.merge(selectedElements);
10751075
mergedElements.transition()
1076-
.attr('transform', (pos: ItemPosition) => {
1077-
const x = 0.5 + (pos.x || 0);
1078-
const y = 0.5 + (pos.y || 0);
1079-
return `translate(${x},${y}) scale(${SELECTED_ITEM_FINAL_SCALE})`;
1080-
})
1076+
.attr(
1077+
'transform',
1078+
(pos: ItemPosition) => {
1079+
const x = 0.5 + (pos.x || 0);
1080+
const y = 0.5 + (pos.y || 0);
1081+
return `translate(${x},${y}) scale(${SELECTED_ITEM_FINAL_SCALE})`;
1082+
})
10811083
.style('opacity', 1);
1082-
mergedElements
1083-
.selectAll('rect')
1084+
mergedElements.selectAll('rect')
10841085
.classed('rotate', true)
10851086
.attr('stroke-opacity', 1);
10861087

@@ -1106,19 +1107,20 @@ class FacetsDiveVizInternal {
11061107
this.comparedLayer.selectAll('.compared').data(comparedBoxes);
11071108

11081109
// ENTER.
1109-
const enterElements = comparedElements
1110-
.enter()
1111-
.append('g')
1112-
.classed('compared', true)
1113-
.attr('transform', (pos: ItemPosition) => {
1114-
const x = 0.5 + (pos.x || 0);
1115-
const y = 0.5 + (pos.y || 0);
1116-
return `translate(${x},${y}) scale(${COMPARED_ITEM_INITIAL_SCALE})`;
1117-
})
1118-
.style('opacity', 0);
1119-
1120-
enterElements
1121-
.append('rect')
1110+
const enterElements = comparedElements.enter()
1111+
.append('g')
1112+
.classed('compared', true)
1113+
.attr(
1114+
'transform',
1115+
(pos: ItemPosition) => {
1116+
const x = 0.5 + (pos.x || 0);
1117+
const y = 0.5 + (pos.y || 0);
1118+
return `translate(${x},${y}) scale(${
1119+
COMPARED_ITEM_INITIAL_SCALE})`;
1120+
})
1121+
.style('opacity', 0);
1122+
1123+
enterElements.append('rect')
11221124
.attr('x', -0.5)
11231125
.attr('y', -0.5)
11241126
.attr('width', 1)
@@ -1129,8 +1131,7 @@ class FacetsDiveVizInternal {
11291131
.attr('stroke-opacity', 0)
11301132
.attr('stroke-width', COMPARED_ITEM_STROKE_WIDTH * 2)
11311133
.attr('fill-opacity', 0);
1132-
enterElements
1133-
.append('rect')
1134+
enterElements.append('rect')
11341135
.attr('x', -0.5)
11351136
.attr('y', -0.5)
11361137
.attr('width', 1)
@@ -1145,14 +1146,15 @@ class FacetsDiveVizInternal {
11451146
// ENTER + UPDATE.
11461147
const mergedElements = enterElements.merge(comparedElements);
11471148
mergedElements.transition()
1148-
.attr('transform', (pos: ItemPosition) => {
1149-
const x = 0.5 + (pos.x || 0);
1150-
const y = 0.5 + (pos.y || 0);
1151-
return `translate(${x},${y}) scale(${COMPARED_ITEM_FINAL_SCALE})`;
1152-
})
1149+
.attr(
1150+
'transform',
1151+
(pos: ItemPosition) => {
1152+
const x = 0.5 + (pos.x || 0);
1153+
const y = 0.5 + (pos.y || 0);
1154+
return `translate(${x},${y}) scale(${COMPARED_ITEM_FINAL_SCALE})`;
1155+
})
11531156
.style('opacity', 1);
1154-
mergedElements
1155-
.selectAll('rect')
1157+
mergedElements.selectAll('rect')
11561158
.classed('rotate', true)
11571159
.attr('stroke-opacity', 1);
11581160

0 commit comments

Comments
 (0)