Skip to content

Instantly share code, notes, and snippets.

View ckinmind's full-sized avatar
💭
Exploring

CK ckinmind

💭
Exploring
  • HangZhou, China
View GitHub Profile
@ckinmind
ckinmind / README.md
Last active December 12, 2017 01:47
Line——历年足球队排位对比比折线图

说明

  • 图表类型:line图(混合散点图,柱状图)
  • 原图地址:Bump Chart (Major League Soccer v3)
  • 图表解释:每个足球队各年的排位变化对比图
  • 适用场景:多个对比目标在某个维度(比如时间)下的变化趋势

知识点

@ckinmind
ckinmind / README.md
Last active December 12, 2017 01:46
Scatter——历年足球队得分对比散点图

说明

  • 图表类型:散点图(力图,柱状图)
  • 原图地址:Major League Soccer v2
  • 图表解释:每个足球队各年的得分变化对比图
  • 适用场景:多个对比目标在某个维度(比如时间)下的变化趋势

知识点

  • d3.forceSimulation - 创建一个力模拟
@ckinmind
ckinmind / README.md
Last active December 11, 2017 09:25
Line——动画效果

说明

  • 图表类型:折线图(面积图)
  • 原图地址:D3 version of animated chart dribbble
  • 原图是d3.v3版本实现,这版用v4版本重写了
  • 改写后的动画有点问题,问题出在ease上,暂时不知道这个带数值的写法

知识点

  • v3版本:d3.time.format("%d-%b-%Y").parse
  • v4版本: d3.timeParse("%d-%b-%Y")
@ckinmind
ckinmind / README.md
Last active December 11, 2017 15:15
Line——Step Chart

说明

  • 图表类型:折线图(Step Line)
  • 原图地址:D3 Step Chart
  • 原图是d3.v3版本实现,这版用v4版本重写了

知识点

  • d3.bisector 使用访问器和比较器二分查找某个值的index值
  • 关于path中的值比如M,V,Z, 参考这里
@ckinmind
ckinmind / README.md
Last active May 31, 2018 07:39
Bar——动态移动

说明

@ckinmind
ckinmind / README.md
Last active December 12, 2017 11:21
Line——animate line

说明

知识点

  • d3.active - 对于一个给定的节点选择活跃中的过渡
  • 关于start事件
@ckinmind
ckinmind / README.md
Last active December 13, 2017 06:28
Other——Chained Transitions

说明

  • 图表类型:other
  • 原图地址:Chained Transitions
  • 备注:对于插值器还是没有很好的理解

知识点

  • d3.active - 对于一个给定的节点选择活跃中的过渡
  • d3.interpolateRgb(a, b) 插补RGB颜色
  • 关于start事件
@ckinmind
ckinmind / README.md
Last active December 13, 2017 09:34
Bar——zoomable histogram

说明

知识点

  • d3.zoom - 创建缩放行为
  • zoom.translateExtent - 设置平移范围
  • zoom.extent - 设置viewport的尺寸
@ckinmind
ckinmind / README.md
Last active December 28, 2017 02:54
histogram——Date slider - histogram legend

说明

  • 图表类型:直方图(混合散点图)
  • 原图地址:Date slider - histogram legend
  • 修改了原图的部分实现,将滑动条部分的实现从line改为rect

知识点

  • d3.histogram - 直方图生成器
  • selections.exit() - 选取失去数据的节点
  • d3.timeParse - 时间格式化
@ckinmind
ckinmind / README.md
Last active January 3, 2018 02:19
histogram——以日期为时间维度

说明

  • 图表类型:直方图(混合散点图)
  • 原图地址:Date slider - histogram legend
  • 修改了原图的部分实现,将滑动条部分的实现从line改为rect
  • 将原图以时间为间隔改为了以天为间隔

知识点

  • d3.histogram - 直方图生成器
  • selections.exit() - 选取失去数据的节点