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

[KED-1729] Add minimap #203

Merged
merged 26 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9024a21
[KED-1729] Initial work on minimap
bru5 Jun 11, 2020
19307ef
[KED-1729] Further work on minimap
bru5 Jun 12, 2020
d633824
Merge branch 'develop' into feature/minimap
bru5 Jun 30, 2020
ffea550
[KED-1729] Added icons for minimap
bru5 Jul 1, 2020
02eb4ec
[KED-1729] Change flowchart zoom behaviour and optimise draw calls
bru5 Jul 1, 2020
0fbb8b4
[KED-1729] Change minimap zoom behaviour and optimise draw calls
bru5 Jul 1, 2020
861034f
[KED-1729] Add minimap toolbar
bru5 Jul 1, 2020
f1c540b
[KED-1729] Fix tests
bru5 Jul 1, 2020
c67dd52
[KED-1729] Refactor change detection
bru5 Jul 2, 2020
d8290d9
[KED-1729] Refactor minimap and chart zoom behaviour and style
bru5 Jul 20, 2020
76ff9f2
[KED-1729] Change minimap themes
bru5 Jul 20, 2020
8790ef4
[KED-1729] Change minimap style
bru5 Jul 20, 2020
84aeb1a
[KED-1729] Change minimap style
bru5 Jul 21, 2020
67ccf65
[KED-1729] Avoid multiple zoom calls on changes
bru5 Jul 21, 2020
a6de596
[KED-1729] Change minimap style
bru5 Jul 21, 2020
da5835f
[KED-1729] Add icon stroke styling
bru5 Jul 22, 2020
3313272
[KED-1729] Refactor toolbars
bru5 Jul 22, 2020
dc41942
[KED-1729] Refactor and improve
bru5 Jul 22, 2020
4435384
[KED-1729] Refactor and improve
bru5 Jul 28, 2020
5a1c3e1
Merge branch 'develop' into feature/minimap
bru5 Jul 28, 2020
4cc4607
[KED-1729] Fix tests on minimap
bru5 Jul 28, 2020
1af47a2
[KED-1729] Revert package-lock
bru5 Jul 28, 2020
1abe56e
[KED-1729] Update package-lock
bru5 Jul 29, 2020
d53dfd9
Merge branch 'develop' into feature/minimap
bru5 Jul 30, 2020
bdc037d
[KED-1899] Changed shadows on minimap
bru5 Jul 31, 2020
e547739
Merge branch 'develop' into feature/minimap
bru5 Aug 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"batching-toposort": "^1.2.0",
"classnames": "^2.2.6",
"d3-fetch": "^1.2.0",
"d3-interpolate": "^1.3.2",
"d3-interpolate-path": "^2.1.0",
"d3-scale": "^3.2.1",
"d3-selection": "^1.4.1",
Expand Down
26 changes: 26 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ export function updateChartSize(chartSize) {
};
}

export const UPDATE_ZOOM = 'UPDATE_ZOOM';

/**
* Store the zoom
* @param {Object} zoom The zoom transform
*/
export function updateZoom(zoom) {
return {
type: UPDATE_ZOOM,
zoom
};
}

export const UPDATE_FONT_LOADED = 'UPDATE_FONT_LOADED';

/**
Expand All @@ -130,6 +143,19 @@ export function updateFontLoaded(fontLoaded) {
};
}

export const TOGGLE_MINIMAP = 'TOGGLE_MINIMAP';

/**
* Toggle mini map
* @param {string} visible Visibility status
*/
export function toggleMiniMap(visible) {
return {
type: TOGGLE_MINIMAP,
visible
};
}

export const CHANGE_FLAG = 'CHANGE_FLAG';

/**
Expand Down
12 changes: 12 additions & 0 deletions src/components/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@
.kui-theme--dark & {
fill: #fff;
}

.pipeline-icon--stroke & {
.kui-theme--light & {
fill: none;
stroke: #333;
}

.kui-theme--dark & {
fill: none;
stroke: #fff;
}
}
}
20 changes: 4 additions & 16 deletions src/components/flowchart/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import icon from './icon';
/**
* Render layer bands
*/
const drawLayers = function() {
export const drawLayers = function() {
const { layers, visibleLayers } = this.props;

this.el.layers = this.el.layerGroup
Expand All @@ -33,7 +33,7 @@ const drawLayers = function() {
/**
* Render layer name labels
*/
const drawLayerNames = function() {
export const drawLayerNames = function() {
const {
chartSize: { sidebarWidth = 0 },
layers,
Expand Down Expand Up @@ -74,7 +74,7 @@ const drawLayerNames = function() {
/**
* Render node icons and name labels
*/
const drawNodes = function() {
export const drawNodes = function() {
const {
centralNode,
linkedNodes,
Expand Down Expand Up @@ -170,7 +170,7 @@ const drawNodes = function() {
/**
* Render edge lines
*/
const drawEdges = function() {
export const drawEdges = function() {
const { edges, centralNode, linkedNodes } = this.props;

this.el.edges = this.el.edgeGroup
Expand Down Expand Up @@ -222,15 +222,3 @@ const drawEdges = function() {
return interpolatePath(previous, current);
});
};

/**
* Render chart to the DOM with D3
*/
const draw = function() {
drawLayers.call(this);
drawLayerNames.call(this);
drawEdges.call(this);
drawNodes.call(this);
};

export default draw;
4 changes: 2 additions & 2 deletions src/components/flowchart/flowchart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe('FlowChart', () => {
const expectedResult = {
centralNode: null,
chartSize: expect.any(Object),
chartZoom: expect.any(Object),
edges: expect.any(Array),
graphSize: expect.any(Object),
layers: expect.any(Array),
Expand All @@ -72,8 +73,7 @@ describe('FlowChart', () => {
nodes: expect.any(Array),
textLabels: expect.any(Boolean),
visibleLayers: expect.any(Boolean),
visibleSidebar: expect.any(Boolean),
zoom: expect.any(Object)
visibleSidebar: expect.any(Boolean)
};
expect(mapStateToProps(mockState.animals)).toEqual(expectedResult);
});
Expand Down
Loading