[hotfix] load selectors in render

This commit is contained in:
Maxime Beauchemin
2017-01-19 15:27:01 -08:00
parent 4a9888157e
commit 0807a8d016
13 changed files with 22 additions and 23 deletions

View File

@@ -5,9 +5,8 @@ require('./directed_force.css');
/* Modified from http://bl.ocks.org/d3noob/5141278 */
function directedForceVis(slice) {
const div = d3.select(slice.selector);
const render = function () {
const div = d3.select(slice.selector);
const width = slice.width();
const height = slice.height() - 25;
d3.json(slice.jsonEndpoint(), function (error, json) {
@@ -15,6 +14,7 @@ function directedForceVis(slice) {
slice.error(error.responseText, error);
return;
}
console.log(json);
const linkLength = json.form_data.link_length || 200;
const charge = json.form_data.charge || -500;
@@ -92,6 +92,7 @@ function directedForceVis(slice) {
.attr('width', width)
.attr('height', height);
// build the arrow.
svg.append('svg:defs').selectAll('marker')
.data(['end']) // Different link/path types can be defined here