-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update axis ticks and scale when paths are loaded.
This addresses an issue of paths loading and one or more of the axes showing only tick 0, with all the paths connecting to it. This was working but a recent commit disconnected the update, as has happened several times before. Use CP dependencies to update the axis ticks and scale. draw-map.js : add to axisApi : cmNameAdd, makeMapChrName, axisIDAdd. axis-1d.js : added CPs : dataBlocksDomains, referenceBlock, blocksDomains, blocksDomain, blocksDomainEffect, domainEffect. models/block.js : add CP : featuresDomain. feature.js : add CP : valueOrdered. data/block.js : use cmNameAdd(). (viewed() may not be updating - trialling an added dependency and changed use of blockValues()). draw/axes-1d.hbs and axis-1d.hbs : commented-out display of values which may be changed during the render (refn emberjs/ember.js#13948) : axis.view, currentPosition.yDomain. Use blocksDomainEffect. utility-chromosome.js : factor copyChrData() out of chrData(); add cmNameAdd() based on draw-map.js:receiveChr(). frontend/app/ : 6e37a2f 223853 Sep 10 20:25 components/draw-map.js 62cdfc0 22369 Sep 10 21:12 components/draw/axis-1d.js 2b94ee2 24542 Sep 10 20:25 components/draw/block-adj.js 563096e 2943 Sep 10 16:51 mixins/axis-position.js 06c02ae 6638 Sep 10 18:30 models/block.js 930fc67 1021 Sep 9 16:59 models/feature.js 4e7d202 14286 Sep 10 15:14 services/data/block.js cf7716e 356 Sep 10 17:24 templates/components/draw/axes-1d.hbs ed752af 578 Sep 10 18:42 templates/components/draw/axis-1d.hbs 8c18360 3946 Sep 10 15:36 utils/utility-chromosome.js added : 998f0c9 1623 Sep 10 18:30 utils/interval-calcs.js
- Loading branch information
1 parent
2bf1414
commit 52ff438
Showing
11 changed files
with
288 additions
and
26 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
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
axis-1d: {{ extended }} {{ axis.id }} {{ domainChanged }} , {{ position }}, {{ currentPosition }}, {{ lastDrawn }}, {{ currentPosition.yDomain }} {{ zoomed }}, {{ dataBlocks.length }} {{ dataBlocks.0.features.length }} {{ featureLengthEffect }} | ||
{{!-- commented-out values may be changed during the render which | ||
will cause displaying their value to produce an exception, | ||
refn https://github.com/emberjs/ember.js/issues/13948 --}} | ||
axis-1d: {{ extended }} {{ axis.id }}, {{!-- axis.view}} {{axis.view.axisName , --}} {{ domainChanged }} , {{ position }}, {{ currentPosition }}, {{ lastDrawn }}, {{!-- currentPosition.yDomain --}} {{ zoomed }}, {{ dataBlocks.length }} {{ dataBlocks.0.features.length }} {{ featureLengthEffect }} {{ blocksDomainEffect }} | ||
{{ log 'axis-1d rendered domainContents' position }} | ||
{{yield this }} |
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,52 @@ | ||
|
||
/*----------------------------------------------------------------------------*/ | ||
|
||
/* global d3 */ | ||
|
||
/*----------------------------------------------------------------------------*/ | ||
|
||
const | ||
intervalLimit = [d3.min, d3.max], | ||
/** Choose the outside values, as with d3.extent() | ||
* true if value a is outside the domain limit b. | ||
*/ | ||
intervalOutside = [(a, b) => (a < b), | ||
(a, b) => (a > b), | ||
]; | ||
|
||
/** Merge the given interval v into the domain, so that the result domain | ||
* contains the interval. | ||
* | ||
* Used within .reduce(), e.g. : | ||
* intervals.reduce(intervalMerge, []); | ||
* @param domain result of merging the intervals. | ||
* form is [min, max]. | ||
* @param v a single interval (feature value). can be either direction, i.e. doesn't assume f[0] < f[1] | ||
* @see intervalExtent() | ||
*/ | ||
function intervalMerge(domain, v) { | ||
// let v = f.get('valueOrdered'); | ||
|
||
[0, 1].forEach(function (i) { | ||
/** the limit value of the interval v, in the direction i. | ||
* The result domain is ordered [min, max] whereas the input values v are | ||
* not; this translates the unordered value to the ordered result. | ||
*/ | ||
let limit = intervalLimit[i](v); | ||
if ((domain[i] === undefined) || intervalOutside[i](limit, domain[i])) | ||
domain[i] = limit; | ||
}); | ||
|
||
return domain; | ||
} | ||
|
||
/** Calculate the union of the given intervals. | ||
*/ | ||
function intervalExtent(intervals) { | ||
let extent = intervals.reduce(intervalMerge, []); | ||
return extent; | ||
} | ||
|
||
/*----------------------------------------------------------------------------*/ | ||
|
||
export { intervalLimit, intervalOutside, intervalMerge, intervalExtent }; |
Oops, something went wrong.