phylotree 2.0.1 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import * as clades from "./clades";
9
9
  import * as render_nodes from "./nodes";
10
10
  import * as render_edges from "./edges";
11
11
  import * as events from "./events";
12
- import { css_classes } from "./options";
12
+ import { css_classes, initializeCssClasses } from "./options";
13
13
  import * as opt from "./options";
14
14
  import * as menus from "./menus";
15
15
 
@@ -22,6 +22,7 @@ function constant(x) {
22
22
 
23
23
  class TreeRender {
24
24
  constructor(phylotree, options = {}) {
25
+ initializeCssClasses(options['css-classes']);
25
26
  this.css_classes = css_classes;
26
27
  this.phylotree = phylotree;
27
28
  this.container = options.container;
@@ -18,6 +18,12 @@ export const css_classes = {
18
18
  node_text: "phylotree-node-text"
19
19
  };
20
20
 
21
+ export function initializeCssClasses(classes = {}) {
22
+ Object.keys(classes).forEach(key => {
23
+ css_classes[key] = classes[key]
24
+ })
25
+ }
26
+
21
27
  export function internalNames(attr) {
22
28
  if (!arguments.length) return this.options["internal-names"];
23
29
  this.options["internal-names"] = attr;