Browse Source

Rename onend to done in flow API - #314

pull/319/head
Masayuki Tanaka 11 years ago
parent
commit
b8c21eb32e
  1. 6
      c3.js
  2. 4
      c3.min.js
  3. 10
      htdocs/samples/api_flow.html

6
c3.js

@ -4050,7 +4050,7 @@
flowEnd = getValueOnIndex(c3.data.targets[0].values, flowIndex + flowLength), flowEnd = getValueOnIndex(c3.data.targets[0].values, flowIndex + flowLength),
orgDomain = x.domain(), domain, orgDomain = x.domain(), domain,
durationForFlow = options.flow.duration || duration, durationForFlow = options.flow.duration || duration,
onend = options.flow.onend || function () {}, done = options.flow.done || function () {},
wait = generateWait(); wait = generateWait();
// remove head data after rendered // remove head data after rendered
@ -4157,7 +4157,7 @@
.attr("height", __axis_rotated ? rectW : height); .attr("height", __axis_rotated ? rectW : height);
// callback for end of flow // callback for end of flow
onend(); done();
}); });
} : null); } : null);
@ -4983,7 +4983,7 @@
index: baseValue.index, index: baseValue.index,
length: length, length: length,
duration: isValue(args.duration) ? args.duration : __transition_duration, duration: isValue(args.duration) ? args.duration : __transition_duration,
onend: args.onend, done: args.done,
orgDataCount: orgDataCount, orgDataCount: orgDataCount,
}, },
withLegend: true, withLegend: true,

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

10
htdocs/samples/api_flow.html

@ -68,7 +68,7 @@
], ],
duration: 1500, duration: 1500,
onend: function () { done: function () {
// Load 2 data without data2 and remove 1 data // Load 2 data without data2 and remove 1 data
chart.flow({ chart.flow({
columns: [ columns: [
@ -78,7 +78,7 @@
length: 0, length: 0,
duration: 1500, duration: 1500,
onend: function () { done: function () {
chart.flow({ chart.flow({
columns: [ columns: [
['data1', 200, 300], ['data1', 200, 300],
@ -87,7 +87,7 @@
], ],
length: 2, length: 2,
duration: 1500, duration: 1500,
onend: function () { done: function () {
chart.flow({ chart.flow({
columns: [ columns: [
@ -101,7 +101,7 @@
} }
}); });
}// onend }// done
}); });
}, },
@ -164,7 +164,7 @@
['data3', 200, 300], ['data3', 200, 300],
], ],
duration: 1500, duration: 1500,
onend: function () { done: function () {
chart.flow({ chart.flow({
columns: [ columns: [
['data1', 200], ['data1', 200],

Loading…
Cancel
Save