|
Last change
on this file since a762898 was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
642 bytes
|
| Line | |
|---|
| 1 | export function initRange(domain, range) {
|
|---|
| 2 | switch (arguments.length) {
|
|---|
| 3 | case 0: break;
|
|---|
| 4 | case 1: this.range(domain); break;
|
|---|
| 5 | default: this.range(range).domain(domain); break;
|
|---|
| 6 | }
|
|---|
| 7 | return this;
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | export function initInterpolator(domain, interpolator) {
|
|---|
| 11 | switch (arguments.length) {
|
|---|
| 12 | case 0: break;
|
|---|
| 13 | case 1: {
|
|---|
| 14 | if (typeof domain === "function") this.interpolator(domain);
|
|---|
| 15 | else this.range(domain);
|
|---|
| 16 | break;
|
|---|
| 17 | }
|
|---|
| 18 | default: {
|
|---|
| 19 | this.domain(domain);
|
|---|
| 20 | if (typeof interpolator === "function") this.interpolator(interpolator);
|
|---|
| 21 | else this.range(interpolator);
|
|---|
| 22 | break;
|
|---|
| 23 | }
|
|---|
| 24 | }
|
|---|
| 25 | return this;
|
|---|
| 26 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.