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

misc ideas #67

Open
1wheel opened this issue May 20, 2020 · 0 comments
Open

misc ideas #67

1wheel opened this issue May 20, 2020 · 0 comments

Comments

@1wheel
Copy link
Collaborator

1wheel commented May 20, 2020

  • Option to have loadData cache files; useful for hot reloading big things
if (window.resCache){
  fmtData()
  init()
} else{
  d3.loadData('round-1.csv', 'round-2.csv', (err, res) => {
    window.resCache = res
    fmtData()
    init()
  })
}
  • Fix named timers
  • Besides .key, nestBy should have sortBy on array elements. The top level array should expose the map used to construct it.
  • Pass object to nestBy:
  var stateData = d3.nestBy(may11, d => d.prediction_date + d.target_date + d.state)
  stateData.forEach(d => {
    var f = d[0]
    d.prediction_date = d[0].prediction_date
    d.target_date = d[0].target_date
    d.state = d[0].state
  • If d attribute is an array, join it with a space

.at({d: d => ['M', c.x(d.i), , 'H 0'].join(' ')})

.at({d: d => ['M', c.x(d.i), , 'H 0']})

  • addAxisLabel

Maybe incorporate into drawAxis

function addAxisLabel(c, xText, yText){
  c.svg.select('.x').append('g')
    .translate([c.width/2, 35])
    .append('text')
    .text(xText)
    .at({textAnchor: 'middle'})
    .st({fill: '#000', fontWeight: 600})

  c.svg.select('.y')
    .append('g')
    .translate([-50, c.height/2])
    .append('text')
    .text(yText)
    .at({textAnchor: 'middle', transform: 'rotate(-90)'})
    .st({fill: '#000', fontWeight: 600})

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

No branches or pull requests

1 participant