Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d3.svg.month #449

Closed
mbostock opened this issue Jan 20, 2012 · 2 comments
Closed

d3.svg.month #449

mbostock opened this issue Jan 20, 2012 · 2 comments
Milestone

Comments

@mbostock
Copy link
Member

It might be nice to take this code out of the calendar example and include it in the core library:

function monthPath(t0) {
  var t1 = new Date(t0.getFullYear(), t0.getMonth() + 1, 0),
      d0 = +day(t0), w0 = +week(t0),
      d1 = +day(t1), w1 = +week(t1);
  return "M" + (w0 + 1) * size + "," + d0 * size
      + "H" + w0 * size + "V" + 7 * size
      + "H" + w1 * size + "V" + (d1 + 1) * size
      + "H" + (w1 + 1) * size + "V" + 0
      + "H" + (w0 + 1) * size + "Z";
}

Some convenient extensions:

  • The size should be configurable.
  • The use of Sunday- or Monday-based weeks should be configurable.
  • Vertical or horizontal orientation might be nice.
  • Positioning relative to the first week in the month rather than the first week in the year.
@davidadamhancock
Copy link

Hi
I was wondering if you could help me. I am very much interested in this piece of code because I want to add a legend and month labels to D3CalenderView so I can do some heatmaps and tell whether I am on target for bookings during the year new to DOM and SVG so first I would like to know what the return string is doing and second I would like to know if you know any good references to get this task done

@mgold
Copy link
Contributor

mgold commented Jan 17, 2015

Try the mailing list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants