Skip to content

Commit

Permalink
update the way jquery works and return the visualisation object
Browse files Browse the repository at this point in the history
  • Loading branch information
bmesuere committed Sep 18, 2017
1 parent 36fac34 commit d9c22fa
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 189 deletions.
92 changes: 16 additions & 76 deletions dist/unipept-visualizations.es5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/unipept-visualizations.es5.js.map

Large diffs are not rendered by default.

66 changes: 9 additions & 57 deletions dist/unipept-visualizations.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/unipept-visualizations.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/unipept-visualizations.min.js

Large diffs are not rendered by default.

20 changes: 3 additions & 17 deletions src/sunburst/sunburst.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,20 +503,6 @@ export default class Sunburst {
}
}

function Plugin(userData, option) {
return this.each(function () {
let $this = $(this);
let data = $this.data("vis.sunburst");
let options = $.extend({}, $this.data(), typeof option === "object" && option);

if (!data) {
$this.data("vis.sunburst", (data = new Sunburst(this, userData, options)));
}
if (typeof option === "string") {
data[option]();
}
});
}

$.fn.sunburst = Plugin;
$.fn.sunburst.Constructor = Sunburst;
$.fn.sunburst = function (data, options) {
return new Sunburst(this.get(0), data, options);
};
20 changes: 3 additions & 17 deletions src/treemap/treemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,20 +316,6 @@ export default function TreeMap(element, data, options = {}) {
return that;
}

function Plugin(userData, option) {
return this.each(function () {
let $this = $(this);
let data = $this.data("vis.treemap");
let options = $.extend({}, $this.data(), typeof option === "object" && option);

if (!data) {
$this.data("vis.treemap", (data = new TreeMap(this, userData, options)));
}
if (typeof option === "string") {
data[option]();
}
});
}

$.fn.treemap = Plugin;
$.fn.treemap.Constructor = TreeMap;
$.fn.treemap = function (data, options) {
return new TreeMap(this.get(0), data, options);
};
20 changes: 3 additions & 17 deletions src/treeview/treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,20 +448,6 @@ export default function TreeView(element, data, options = {}) {
return that;
}

function Plugin(userData, option) {
return this.each(function () {
let $this = $(this);
let data = $this.data("vis.treeview");
let options = $.extend({}, $this.data(), typeof option === "object" && option);

if (!data) {
$this.data("vis.treeview", (data = new TreeView(this, userData, options)));
}
if (typeof option === "string") {
data[option]();
}
});
}

$.fn.treeview = Plugin;
$.fn.treeview.Constructor = TreeView;
$.fn.treeview = function (data, options) {
return new TreeView(this.get(0), data, options);
};

0 comments on commit d9c22fa

Please sign in to comment.