Skip to content

Commit 64cc883

Browse files
committed
RMB Button Menu
1 parent a692faa commit 64cc883

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/js/contextMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ window.Widgets.ContextMenu = {};
1010
svgId,) {
1111

1212
ns.menuFactory(d.x, d.y, menuItems, d, svgId);
13-
d3.event.preventDefault();
13+
//d3.event.preventDefault();
1414

1515
}
1616

src/js/graph.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ window.Widgets.Graph = {};
7777

7878
options.steps = ["initSVG"];
7979

80-
options.$object_form = $component.find('#promo_panel');
81-
options.$working_svg = $component.find('#scratch_panel');
80+
options.$promo_panel = $component.find('#promo_panel');
81+
options.$scratch_panel = $component.find('#scratch_panel');
8282
//
8383
// Step 1: Setup the 3 svg's and the tooltip
8484
options.promotable_svg = d3.select('#promo_panel')
8585
.append('svg')
86-
.attr('width', browserNs.ow(options.$object_form) )
87-
.attr('height', browserNs.oh(options.$object_form))
86+
.attr('width', browserNs.ow(options.$promo_panel) )
87+
.attr('height', browserNs.oh(options.$promo_panel))
8888
.attr('class', 'promotable_svg');
8989
options.scratch_svg = d3.select('#scratch_panel')
9090
.append('svg')
91-
.attr('width', browserNs.ow(options.$working_svg) )
92-
.attr('height', browserNs.oh(options.$working_svg))
91+
.attr('width', browserNs.ow(options.$scratch_panel) )
92+
.attr('height', browserNs.oh(options.$scratch_panel))
9393
.attr('class', 'scratch_svg');
9494
options.tooltip = d3
9595
.select('body')
@@ -585,7 +585,7 @@ window.Widgets.Graph = {};
585585
options.pforceLink = d3
586586
.forceLink(options.split.promo.edges)
587587
.id(function (d) {
588-
console.log('pforceLink->', d);
588+
// console.log('pforceLink->', d);
589589
return d.id
590590
}) // (d) => d.data.id
591591
.distance(4 * options.icon_size);

src/js/indentTree.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ window.Widgets.IndentTree = {};
44

55
(function ($, ns, d3, document, window) {
66

7-
ns.indentTree = function(data, tree_svg, options = {}) {
7+
ns.indentTree = function(data, contextMenuNs, tree_svg, options = {}) {
88

99
// WARNING: x and y are switched because the d3.tree is vertical rather than the default horizontal
1010
var theme = {};
@@ -50,7 +50,7 @@ window.Widgets.IndentTree = {};
5050

5151
// Function that assembles the HTML tooltip string
5252
let htmltooltip = function (d) {
53-
console.log('d->',d);
53+
// console.log('d->',d);
5454
// setup tooltip paragraph style
5555
let pgraph_style = '<p style="font-size:' + toString(theme.tooltip.tsize) + '">';
5656
pgraph_style += '<font color="' + theme.tooltip.tcolour +'">';
@@ -322,7 +322,7 @@ window.Widgets.IndentTree = {};
322322
.on("mousemove", mousemove)
323323
.on("mouseout.tooltip", mouseleave)
324324
.on('contextmenu', (d) => {
325-
window.Widgets.contextMenuNs.createContextMenu(d, treeMenuItems, '.index_svg');
325+
contextMenuNs.createContextMenu(d, treeMenuItems, '.index_svg');
326326
});
327327

328328
// label text

src/js/widget.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ window.Widgets.Widget = {};
142142
d3.json('data/sightingIndex.json').then(function (data) {
143143
console.log(data);
144144
console.log('I am rendering first time');
145-
indentTreeNs.indentTree(data, index_svg, options);
145+
indentTreeNs.indentTree(data, contextMenuNs, index_svg, options);
146146
});
147147

148148
d3.json(ns.scratch).then(function (data) {
@@ -204,7 +204,7 @@ window.Widgets.Widget = {};
204204
console.group("d3.json.then");
205205
console.log(data);
206206
console.log('I am ready to re-render the tree');
207-
indentTreeNs.indentTree(data, index_svg, ns.options);
207+
indentTreeNs.indentTree(data, contextMenuNs, index_svg, ns.options);
208208
console.groupEnd();
209209
});
210210
console.groupEnd();

0 commit comments

Comments
 (0)