From a195929ff0bdc640a5b88d72dadc0548cb9102ec Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Thu, 16 May 2013 13:53:33 +1200 Subject: Add axis labels and help text --- public/css/style.css | 44 +++++++++++++++++++++++++++++++++++++++++++- public/index.html | 16 +++++++++++++++- public/js/mv/chart.js | 33 +++++++++++++++++++++++---------- 3 files changed, 81 insertions(+), 12 deletions(-) (limited to 'public') diff --git a/public/css/style.css b/public/css/style.css index 206415e..a73e2dd 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -126,11 +126,44 @@ h3 { text-anchor: end; } -#stat-chart text.dim-label { +#stat-chart text.dim-label, .axis-label { font: 12px sans-serif; font-weight: bold; } +.axis-label { + height: 0; + width: 0; + position: relative; + white-space: nowrap; +} + +.x-axis-label { + left: 50%; +} + +.y-axis-label { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + transform: rotate(-90deg); + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + -o-transform-origin: 50% 50%; + transform-origin: 50% 50%; +} + +/* Chart meta info */ + +p.info { + font: 10px sans-serif; + color: #777; + margin: 0 .4em; + padding: 0; +} + /* User list */ #connection-warning { @@ -156,6 +189,15 @@ h3 { margin: 0 2em; } +#users-status .channel:before { + content: "channel"; + font: 10px sans-serif; + color: "#888"; + padding: 0; + margin: 0; + display: block; +} + #users-status a { margin-left: 1em; } diff --git a/public/index.html b/public/index.html index e593f2b..160aa99 100644 --- a/public/index.html +++ b/public/index.html @@ -10,13 +10,19 @@

Manavis users

+

These are the other users currently online on manavis. If you find something interesting to show, create a channel and get people to join to take a look!

Character base level

+
XP instances
+
Base level

Stat allocation

+

The more intense the color, the more XP instances.
+ Each subchart relates one attribute to another. This is redundant in places, such as with the str-agi chart and the agi-str chart, so the chart is symmetric.
+ To get an idea of how this works, try filtering a range of low levels above, then slide the filter right, watching how the stats increase as people gain more levels and can get more stats.

@@ -32,15 +38,23 @@

Number of attackers

+

The number of characters responsible for attacking the mob. One character attacking a mob directly, and another attacking it with a dozen summons, would count as two attackers.

+
XP instances
+
Characters

Date

+
XP instances
+
Date
-

Map [?]

+

Map

+

The larger the bubble, the more XP instances for that map.

+
Total job XP gain
+
Total level XP gain
diff --git a/public/js/mv/chart.js b/public/js/mv/chart.js index 288a1de..5cda3ba 100644 --- a/public/js/mv/chart.js +++ b/public/js/mv/chart.js @@ -27,8 +27,9 @@ var mv = function(mv) { .x(d3.scale.linear().domain([0, mv.heap.numAttackers.dim.top(1)[0].numAttackers + 0.5])) .elasticX(true) ; - mv.charts.map = monoGroup(margined(wide(dc.bubbleChart("#map-chart"))), "map") - .height(500) + mv.charts.map = height(monoGroup(margined(wide(dc.bubbleChart("#map-chart"))) + , "map") + , 500) .colorCalculator(d3.scale.category20c()) /* X */ .keyAccessor(function(d) { return d.value.e + 1; }) @@ -87,33 +88,45 @@ var mv = function(mv) { function wide(chart) { return chart .width(wideWidth) - ; + ; } function med(chart) { return chart .width(medWidth) - ; + ; } function thin(chart) { return chart .width(thinWidth) - ; + ; } function short(chart) { + return height(chart, 130); + } + function height(chart, size) { + chart.root() + .selectAll(".y-axis-label") + .style("top", (size / 2 + 25) + "px") + ; + chart.root() + .selectAll(".x-axis-label") + .style("top", (size - 15) + "px") + ; return chart - .height(130) - ; + .height(size) + ; } function margined(chart) { return chart .margins({left: 60, right: 18, top: 5, bottom: 30}) + ; } function monoGroup(chart, name) { return chart .dimension(mv.heap[name].dim) .group(mv.heap[name].group) .transitionDuration(500) - ; + ; } function bar(chart) { return margined(short(chart)) @@ -122,14 +135,14 @@ var mv = function(mv) { .renderHorizontalGridLines(true) .title(function(d) { return d.key + ": " + d.value; }) .brushOn(true) - ; + ; } function pie(chart) { return thin(chart) .radius(80) .height(165) .colorCalculator(d3.scale.category20c()) - ; + ; } return mv; }(mv || {}); -- cgit v1.2.3-70-g09d2