Skip to content

Commit 307d35d

Browse files
Graph view seeking when expanding tabular view, style improvements
1 parent 42018e2 commit 307d35d

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iknow-entity-browser",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"description": "Visualizer for iKnow entities",
55
"main": "gulpfile.babel.js",
66
"scripts": {

src/static/js/graph/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let svg = null,
1313
links,
1414
nodes,
1515
zoomer = d3.zoom()
16-
.scaleExtent([1/4, 100])
16+
.scaleExtent([1/6, 100])
1717
.on("zoom", () => {
1818
view.attr("transform", d3.event.transform);
1919
}),
@@ -50,6 +50,12 @@ let svg = null,
5050
}),
5151
view = null;
5252

53+
export function translateZoom (x = 0, y = 0) {
54+
svg.transition()
55+
.duration(300)
56+
.call(zoomer.translateBy, x, y);
57+
}
58+
5359
export function updateSelected () {
5460
node.classed("selected", p => p.selected);
5561
}

src/static/js/tabular/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
} from "../selection";
66
import { getOption } from "../settings/values";
77
import { getObjProp } from "../utils";
8+
import { translateZoom } from "../graph";
89

910
let sorting = {
1011
properties: ["entities", "0", "frequency"],
@@ -146,6 +147,8 @@ export function init () {
146147
d3.select("#table").classed("active", d.tabularToggled);
147148
if (d.tabularToggled)
148149
updateAll();
150+
let w = document.getElementById("table").getBoundingClientRect().width / 2;
151+
translateZoom(d.tabularToggled ? -w : w);
149152
});
150153

151154
d3.select("#exportCSV").on("click", () => {

src/static/scss/basic.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ input[type=text], input[type=number] {
3939

4040
select {
4141

42+
cursor: pointer;
4243
border: 0;
4344
background: none;
4445
color: inherit;

src/static/scss/graph.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
.node {
2727

28+
cursor: pointer;
29+
2830
circle {
2931
stroke: #fff;
3032
stroke-width: 1px;

0 commit comments

Comments
 (0)