From f6655c001482f8ac25683c344c08567c604f6e9e Mon Sep 17 00:00:00 2001 From: jos Date: Fri, 10 Oct 2014 10:50:43 +0200 Subject: [PATCH 1/2] Fix in positioning of text label of node --- lib/network/Node.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/network/Node.js b/lib/network/Node.js index a1fe8704..e70ec7e1 100644 --- a/lib/network/Node.js +++ b/lib/network/Node.js @@ -878,7 +878,7 @@ Node.prototype._label = function (ctx, text, x, y, align, baseline, labelUnderNo var lines = text.split('\n'); var lineCount = lines.length; - var fontSize = (Number(this.options.fontSize) + 4); + var fontSize = (Number(this.options.fontSize) + 4); // TODO: why is this +4 ? var yLine = y + (1 - lineCount) / 2 * fontSize; if (labelUnderNode == true) { yLine = y + (1 - lineCount) / (2 * fontSize); @@ -893,7 +893,7 @@ Node.prototype._label = function (ctx, text, x, y, align, baseline, labelUnderNo var height = this.options.fontSize * lineCount; var left = x - width / 2; var top = y - height / 2; - if (ctx.textBaseline == "top") { + if (baseline == "top") { top += 0.5 * fontSize; } this.labelDimensions = {top:top,left:left,width:width,height:height,yLine:yLine}; From 394fd7385139fba2a25615aacd5ba952d96b39d4 Mon Sep 17 00:00:00 2001 From: jos Date: Fri, 10 Oct 2014 11:31:43 +0200 Subject: [PATCH 2/2] Added new examples to the index page --- examples/timeline/29_hiding_times.html | 75 +++++++++--------- examples/timeline/30_subgroups.html | 104 ++++++++++++------------- examples/timeline/index.html | 6 +- 3 files changed, 94 insertions(+), 91 deletions(-) diff --git a/examples/timeline/29_hiding_times.html b/examples/timeline/29_hiding_times.html index 3bcd3579..e0043225 100644 --- a/examples/timeline/29_hiding_times.html +++ b/examples/timeline/29_hiding_times.html @@ -1,54 +1,55 @@ - Timeline | Hiding times demo + Timeline | Hiding times demo - + - - + +
\ No newline at end of file diff --git a/examples/timeline/30_subgroups.html b/examples/timeline/30_subgroups.html index 84689188..a1ff27f9 100644 --- a/examples/timeline/30_subgroups.html +++ b/examples/timeline/30_subgroups.html @@ -1,27 +1,27 @@ - Timeline | Background areas + Timeline | Background areas - + .vis.timeline .item.background.negative { + background-color: rgba(255, 0, 0, 0.2); + } + .vis.timeline .item.background.positive { + background-color: rgba(105, 255, 98, 0.20); + } + .vis.timeline .item.background.marker { + border-left: 2px solid green; + } + - - + + @@ -30,43 +30,43 @@
diff --git a/examples/timeline/index.html b/examples/timeline/index.html index 9d2d8946..695c27a2 100644 --- a/examples/timeline/index.html +++ b/examples/timeline/index.html @@ -37,8 +37,10 @@

23_data_attributes.html

24_all_data_attributes.html

25_background_areas.html

-

26_templates.html

-

27_external_data.html

+

26_external_data.html

+

27_templates.html

+

29_hiding_times.html

+

30_subgroups.html

requirejs_example.html