Showing 63 of 102 files from the diff.
Newly tracked file
src/format.ts changed.
Newly tracked file
src/index.ts changed.
Newly tracked file
src/selection.ts changed.
Newly tracked file
src/shape.line.ts changed.
Newly tracked file
src/api.pie.ts changed.
Newly tracked file
src/interaction.ts changed.
Newly tracked file
src/config.ts changed.
Newly tracked file
src/class.ts changed.
Newly tracked file
src/axis.ts changed.
Newly tracked file
src/api.zoom.ts changed.
Newly tracked file
src/subchart.ts changed.
Newly tracked file
src/drag.ts changed.
Newly tracked file
src/type.ts changed.
Newly tracked file
src/api.group.ts changed.
Newly tracked file
src/scale.ts changed.
Newly tracked file
src/size.ts changed.
Newly tracked file
src/color.ts changed.
Newly tracked file
src/text.ts changed.
Newly tracked file
src/shape.ts changed.
Newly tracked file
src/api.show.ts changed.
Newly tracked file
src/api.legend.ts changed.
Newly tracked file
src/api.x.ts changed.
Newly tracked file
src/api.selection.ts changed.
Newly tracked file
src/api.load.ts changed.
Newly tracked file
src/api.transform.ts changed.
Newly tracked file
src/api.category.ts changed.
Newly tracked file
src/title.ts changed.
Newly tracked file
src/data.load.ts changed.
Newly tracked file
src/stanfordelements.ts changed.
Newly tracked file
src/chart.ts changed.
Newly tracked file
src/region.ts changed.
Newly tracked file
src/domain.ts changed.
Newly tracked file
src/shape.bar.ts changed.
Newly tracked file
src/legend.ts changed.
Newly tracked file
src/grid.ts changed.
Newly tracked file
src/data.convert.ts changed.
Newly tracked file
src/core.ts changed.
Newly tracked file
src/api.region.ts changed.
Newly tracked file
src/arc.ts changed.
Newly tracked file
src/stanford.ts changed.
Newly tracked file
src/ua.ts changed.
Newly tracked file
src/colorscale.ts changed.
Newly tracked file
src/api.color.ts changed.
Newly tracked file
src/tooltip.ts changed.
Newly tracked file
src/category.ts changed.
Newly tracked file
src/api.subchart.ts changed.
Newly tracked file
src/api.donut.ts changed.
Newly tracked file
src/api.chart.ts changed.
Newly tracked file
src/api.flow.ts changed.
Newly tracked file
src/zoom.ts changed.
Newly tracked file
src/api.grid.ts changed.
Newly tracked file
src/api.tooltip.ts changed.
Newly tracked file
src/cache.ts changed.
Newly tracked file
src/data.ts changed.
Newly tracked file
src/api.axis.ts changed.
Newly tracked file
src/api.data.ts changed.
Newly tracked file
src/polyfill.ts changed.
Newly tracked file
src/util.ts changed.
Newly tracked file
src/api.focus.ts changed.
Newly tracked file
src/class-utils.ts changed.
Newly tracked file
src/clip.ts changed.

@@ -2,13 +2,20 @@
Loading
2 2
import { isValue, isFunction, isString, isEmpty, getBBox } from './util'
3 3
import { AxisInternal } from './axis-internal'
4 4
5 -
export default class Axis {
5 +
export default class AxisClass {
6 +
  owner: any
7 +
  d3: any
8 +
  internal: typeof AxisInternal
9 +
6 10
  constructor(owner) {
7 11
    this.owner = owner
8 12
    this.d3 = owner.d3
9 13
    this.internal = AxisInternal
10 14
  }
11 15
}
16 +
17 +
const Axis = AxisClass as any
18 +
12 19
Axis.prototype.init = function init() {
13 20
  var $$ = this.owner,
14 21
    config = $$.config,
15 22
imilarity index 100%
16 23
ename from src/cache.js
17 24
ename to src/cache.ts
18 25
imilarity index 100%
19 26
ename from src/category.js
20 27
ename to src/category.ts
21 28
imilarity index 89%
22 29
ename from src/chart-internal.js
23 30
ename to src/chart-internal.ts

@@ -70,7 +70,7 @@
Loading
70 70
        // line/area selection not supported yet
71 71
        return
72 72
      }
73 -
      if (isWithin ^ isIncluded) {
73 +
      if ((isWithin as any) ^ isIncluded) {
74 74
        shape.classed(CLASS.INCLUDED, !isIncluded)
75 75
        // TODO: included/unincluded callback here
76 76
        shape.classed(CLASS.SELECTED, !isSelected)
77 77
imilarity index 100%
78 78
ename from src/format.js
79 79
ename to src/format.ts
80 80
imilarity index 100%
81 81
ename from src/grid.js
82 82
ename to src/grid.ts
83 83
imilarity index 100%
84 84
ename from src/index.js
85 85
ename to src/index.ts
86 86
imilarity index 100%
87 87
ename from src/interaction.js
88 88
ename to src/interaction.ts
89 89
imilarity index 99%
90 90
ename from src/legend.js
91 91
ename to src/legend.ts

@@ -1,6 +1,6 @@
Loading
1 1
import { ChartInternal } from './core'
2 2
3 -
function c3LogScale(d3, linearScale, logScale) {
3 +
function c3LogScale(d3, linearScale?, logScale?) {
4 4
  var PROJECTION = [0.01, 10]
5 5
6 6
  if (!linearScale) {
7 7
imilarity index 100%
8 8
ename from src/selection.js
9 9
ename to src/selection.ts
10 10
imilarity index 100%
11 11
ename from src/shape.bar.js
12 12
ename to src/shape.bar.ts
13 13
imilarity index 100%
14 14
ename from src/shape.line.js
15 15
ename to src/shape.line.ts
16 16
imilarity index 99%
17 17
ename from src/shape.js
18 18
ename to src/shape.ts

@@ -27,7 +27,7 @@
Loading
27 27
      }
28 28
    }
29 29
  )
30 -
  indices.__max__ = i - 1
30 +
  ;(indices as any).__max__ = i - 1
31 31
  return indices
32 32
}
33 33
ChartInternal.prototype.getShapeX = function(
34 34
imilarity index 100%
35 35
ename from src/size.js
36 36
ename to src/size.ts
37 37
imilarity index 100%
38 38
ename from src/stanford.js
39 39
ename to src/stanford.ts
40 40
imilarity index 100%
41 41
ename from src/stanfordelements.js
42 42
ename to src/stanfordelements.ts
43 43
imilarity index 100%
44 44
ename from src/subchart.js
45 45
ename to src/subchart.ts
46 46
imilarity index 100%
47 47
ename from src/text.js
48 48
ename to src/text.ts
49 49
imilarity index 100%
50 50
ename from src/title.js
51 51
ename to src/title.ts
52 52
imilarity index 100%
53 53
ename from src/tooltip.js
54 54
ename to src/tooltip.ts
55 55
imilarity index 100%
56 56
ename from src/type.js
57 57
ename to src/type.ts
58 58
imilarity index 100%
59 59
ename from src/ua.js
60 60
ename to src/ua.ts
61 61
imilarity index 95%
62 62
ename from src/util.js
63 63
ename to src/util.ts

@@ -4,8 +4,8 @@
Loading
4 4
  // When bundling esm output. Beware of changing this line.
5 5
  // TODO: Maybe we should check that the modification by rollup-plugin-modify
6 6
  // is valid during unit tests.
7 -
  $$.d3 = window.d3
8 -
    ? window.d3
7 +
  $$.d3 = (window as any).d3
8 +
    ? (window as any).d3
9 9
    : typeof require !== 'undefined'
10 10
    ? require('d3')
11 11
    : undefined
12 12
imilarity index 100%
13 13
ename from src/chart.js
14 14
ename to src/chart.ts
15 15
imilarity index 100%
16 16
ename from src/class-utils.js
17 17
ename to src/class-utils.ts
18 18
imilarity index 100%
19 19
ename from src/class.js
20 20
ename to src/class.ts
21 21
imilarity index 100%
22 22
ename from src/clip.js
23 23
ename to src/clip.ts
24 24
imilarity index 100%
25 25
ename from src/color.js
26 26
ename to src/color.ts
27 27
imilarity index 100%
28 28
ename from src/colorscale.js
29 29
ename to src/colorscale.ts
30 30
imilarity index 100%
31 31
ename from src/config.js
32 32
ename to src/config.ts
33 33
imilarity index 97%
34 34
ename from src/core.js
35 35
ename to src/core.ts

@@ -325,8 +325,8 @@
Loading
325 325
    firstX = xDomain[0],
326 326
    lastX = xDomain[1],
327 327
    padding = $$.getXDomainPadding(xDomain),
328 -
    min = 0,
329 -
    max = 0
328 +
    min: Date | number = 0,
329 +
    max: Date | number = 0
330 330
  // show center of x domain if min and max are the same
331 331
  if (firstX - lastX === 0 && !$$.isCategorized()) {
332 332
    if ($$.isTimeSeries()) {
333 333
imilarity index 98%
334 334
ename from src/drag.js
335 335
ename to src/drag.ts

@@ -243,7 +243,7 @@
Loading
243 243
      maxLength
244 244
245 245
    // MEMO: care about condifion of step, totalLength
246 -
    function updateValues(id, withoutStep) {
246 +
    function updateValues(id, withoutStep?: boolean) {
247 247
      if (!withoutStep) {
248 248
        margin = (areaLength - totalLength - itemLength) / 2
249 249
        if (margin < posMin) {
250 250
imilarity index 99%
251 251
ename from src/polyfill.js
252 252
ename to src/polyfill.ts

@@ -1198,32 +1198,7 @@
Loading
1198 1198
    $$.resizeFunction()
1199 1199
  }
1200 1200
1201 -
  if (window.attachEvent) {
1202 -
    window.attachEvent('onresize', $$.resizeIfElementDisplayed)
1203 -
  } else if (window.addEventListener) {
1204 -
    window.addEventListener('resize', $$.resizeIfElementDisplayed, false)
1205 -
  } else {
1206 -
    // fallback to this, if this is a very old browser
1207 -
    var wrapper = window.onresize
1208 -
    if (!wrapper) {
1209 -
      // create a wrapper that will call all charts
1210 -
      wrapper = $$.generateResize()
1211 -
    } else if (!wrapper.add || !wrapper.remove) {
1212 -
      // there is already a handler registered, make sure we call it too
1213 -
      wrapper = $$.generateResize()
1214 -
      wrapper.add(window.onresize)
1215 -
    }
1216 -
    // add this graph to the wrapper, we will be removed if the user calls destroy
1217 -
    wrapper.add($$.resizeFunction)
1218 -
    window.onresize = function() {
1219 -
      // if element not displayed skip it
1220 -
      if (!$$.api.element.offsetParent) {
1221 -
        return
1222 -
      }
1223 -
1224 -
      wrapper()
1225 -
    }
1226 -
  }
1201 +
  window.addEventListener('resize', $$.resizeIfElementDisplayed, false)
1227 1202
}
1228 1203
1229 1204
/**
@@ -1313,7 +1288,7 @@
Loading
1313 1288
        }
1314 1289
      }, 50)
1315 1290
    }
1316 -
  f.add = function(transition) {
1291 +
  ;(f as any).add = function(transition) {
1317 1292
    transitionsToWait.push(transition)
1318 1293
  }
1319 1294
  return f
1320 1295
imilarity index 100%
1321 1296
ename from src/data.convert.js
1322 1297
ename to src/data.convert.ts
1323 1298
imilarity index 100%
1324 1299
ename from src/data.load.js
1325 1300
ename to src/data.load.ts
1326 1301
imilarity index 100%
1327 1302
ename from src/data.js
1328 1303
ename to src/data.ts
1329 1304
imilarity index 99%
1330 1305
ename from src/domain.js
1331 1306
ename to src/domain.ts

@@ -128,8 +128,8 @@
Loading
128 128
      updated = $$.updateAngle(d)
129 129
      return updated ? arc(updated) : 'M 0 0'
130 130
    }
131 -
  // TODO: extends all function
132 -
  newArc.centroid = arc.centroid
131 +
    // TODO: extends all function
132 +
  ;(newArc as any).centroid = arc.centroid
133 133
  return newArc
134 134
}
135 135
136 136
imilarity index 99%
137 137
ename from src/axis-internal.js
138 138
ename to src/axis-internal.ts

@@ -245,7 +245,7 @@
Loading
245 245
  function axis(g, transition) {
246 246
    var self
247 247
    g.each(function() {
248 -
      var g = (axis.g = d3.select(this))
248 +
      var g = ((axis as any).g = d3.select(this))
249 249
250 250
      var scale0 = this.__chart__ || internal.scale,
251 251
        scale1 = (this.__chart__ = internal.copyScale())
@@ -499,12 +499,12 @@
Loading
499 499
      interval = internal.tickOffset * 2
500 500
    } else {
501 501
      length =
502 -
        axis.g
502 +
        (axis as any).g
503 503
          .select('path.domain')
504 504
          .node()
505 505
          .getTotalLength() -
506 506
        internal.outerTickSize * 2
507 -
      interval = length / axis.g.selectAll('line').size()
507 +
      interval = length / (axis as any).g.selectAll('line').size()
508 508
    }
509 509
    return interval === Infinity ? 0 : interval
510 510
  }
511 511
imilarity index 99%
512 512
ename from src/axis.js
513 513
ename to src/axis.ts

@@ -26,17 +26,7 @@
Loading
26 26
    window.clearTimeout($$.resizeTimeout)
27 27
  }
28 28
29 -
  if (window.detachEvent) {
30 -
    window.detachEvent('onresize', $$.resizeIfElementDisplayed)
31 -
  } else if (window.removeEventListener) {
32 -
    window.removeEventListener('resize', $$.resizeIfElementDisplayed)
33 -
  } else {
34 -
    var wrapper = window.onresize
35 -
    // check if no one else removed our wrapper and remove our resizeFunction from it
36 -
    if (wrapper && wrapper.add && wrapper.remove) {
37 -
      wrapper.remove($$.resizeFunction)
38 -
    }
39 -
  }
29 +
  window.removeEventListener('resize', $$.resizeIfElementDisplayed)
40 30
41 31
  // Removes the inner resize functions
42 32
  $$.resizeFunction.remove()
43 33
imilarity index 100%
44 34
ename from src/api.color.js
45 35
ename to src/api.color.ts
46 36
imilarity index 100%
47 37
ename from src/api.data.js
48 38
ename to src/api.data.ts
49 39
imilarity index 100%
50 40
ename from src/api.donut.js
51 41
ename to src/api.donut.ts
52 42
imilarity index 100%
53 43
ename from src/api.flow.js
54 44
ename to src/api.flow.ts
55 45
imilarity index 100%
56 46
ename from src/api.focus.js
57 47
ename to src/api.focus.ts
58 48
imilarity index 100%
59 49
ename from src/api.grid.js
60 50
ename to src/api.grid.ts
61 51
imilarity index 100%
62 52
ename from src/api.group.js
63 53
ename to src/api.group.ts
64 54
imilarity index 100%
65 55
ename from src/api.legend.js
66 56
ename to src/api.legend.ts
67 57
imilarity index 100%
68 58
ename from src/api.load.js
69 59
ename to src/api.load.ts
70 60
imilarity index 100%
71 61
ename from src/api.pie.js
72 62
ename to src/api.pie.ts
73 63
imilarity index 100%
74 64
ename from src/api.region.js
75 65
ename to src/api.region.ts
76 66
imilarity index 100%
77 67
ename from src/api.selection.js
78 68
ename to src/api.selection.ts
79 69
imilarity index 100%
80 70
ename from src/api.show.js
81 71
ename to src/api.show.ts
82 72
imilarity index 100%
83 73
ename from src/api.subchart.js
84 74
ename to src/api.subchart.ts
85 75
imilarity index 100%
86 76
ename from src/api.tooltip.js
87 77
ename to src/api.tooltip.ts
88 78
imilarity index 100%
89 79
ename from src/api.transform.js
90 80
ename to src/api.transform.ts
91 81
imilarity index 100%
92 82
ename from src/api.x.js
93 83
ename to src/api.x.ts
94 84
imilarity index 100%
95 85
ename from src/api.zoom.js
96 86
ename to src/api.zoom.ts
97 87
imilarity index 99%
98 88
ename from src/arc.js
99 89
ename to src/arc.ts

@@ -1,4 +1,5 @@
Loading
1 1
/* jshint ignore:start */
2 +
// @ts-nocheck
2 3
3 4
// SVGPathSeg API polyfill
4 5
// https://github.com/progers/pathseg
5 6
imilarity index 100%
6 7
ename from src/region.js
7 8
ename to src/region.ts
8 9
imilarity index 99%
9 10
ename from src/scale.js
10 11
ename to src/scale.ts

@@ -103,7 +103,7 @@
Loading
103 103
 *
104 104
 * @param string agent Optional parameter to specify user agent
105 105
 */
106 -
export var getIEVersion = function(agent) {
106 +
export var getIEVersion = function(agent?: string) {
107 107
  // https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
108 108
  if (typeof agent === 'undefined') {
109 109
    agent = window.navigator.userAgent
@@ -126,9 +126,9 @@
Loading
126 126
/**
127 127
 * Returns whether the used browser is Internet Explorer.
128 128
 *
129 -
 * @param {Number} version Optional parameter to specify IE version
129 +
 * @param version Optional parameter to specify IE version
130 130
 */
131 -
export var isIE = function(version) {
131 +
export var isIE = function(version?: number) {
132 132
  const ver = getIEVersion()
133 133
134 134
  if (typeof version === 'undefined') {
135 135
imilarity index 100%
136 136
ename from src/zoom.js
137 137
ename to src/zoom.ts
Files Coverage
src 70.22%
Project Totals (63 files) 70.22%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading