flrs / visavail

A D3.js Time Data Availability Visualization
https://flrs.github.io/visavail/docs/samples/basic.html
MIT License
310 stars 59 forks source link

Is there any function to reduce the height of visavail status bar. #14

Closed affan00 closed 7 years ago

affan00 commented 7 years ago

I want to reduce the height of the visavail chart. image

Can we change the fonts on it so that it is easier to read. (e.g. Bold for Days, smaller for hours) ?

flrs commented 7 years ago

Hi @affan00!

  1. There are several elements you can adjust to reduce the height of the chart:

  2. In the existing code, there is a way to modify year ticks to be bold. Have a look at the this code:

      var xTicks = xScale.ticks();
      var isYearTick = xTicks.map(isYear);
      var isMonthTick = xTicks.map(isMonth);
      // year emphasis
      // ensure year emphasis is only active if years are the biggest clustering unit
      if (emphasizeYearTicks
          && !(isYearTick.every(function (d) { return d === true; }))
          && isMonthTick.every(function (d) { return d === true; })) {
        d3.selectAll('g.tick').each(function (d, i) {
          if (isYearTick[i]) {
            d3.select(this)
                .attr({
                  'class': 'x_tick_emph',
                });
          }
        });
        d3.selectAll('.vert_grid').each(function (d, i) {
          if (isYearTick[i]) {
            d3.select(this)
                .attr({
                  'class': 'vert_grid_emph',
                });
          }
        });
      }

    You would have to modify that to emphasize whatever interval you want to highlight.

I hope this helps you to reach your goal!