-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from palantir/dev
Merge Dev into Master (ver. 0.1.2)
- Loading branch information
Showing
29 changed files
with
6,719 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
///<reference path="reference.ts" /> | ||
|
||
class ScaleDomainCoordinator { | ||
/* This class is responsible for maintaining coordination between linked scales. | ||
It registers event listeners for when one of its scales changes its domain. When the scale | ||
does change its domain, it re-propogates the change to every linked scale. | ||
*/ | ||
private rescaleInProgress = false; | ||
constructor(private scales: Scale[]) { | ||
this.scales.forEach((s) => s.registerListener((sx: Scale) => this.rescale(sx))); | ||
} | ||
|
||
public rescale(scale: Scale) { | ||
if (this.rescaleInProgress) { | ||
return; | ||
} | ||
this.rescaleInProgress = true; | ||
var newDomain = scale.domain(); | ||
this.scales.forEach((s) => s.domain(newDomain)); | ||
this.rescaleInProgress = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.