Skip to content

Commit

Permalink
Update types for new settings
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Mar 9, 2021
1 parent 3ef8fe7 commit 6eb47b4
Show file tree
Hide file tree
Showing 25 changed files with 47 additions and 124 deletions.
15 changes: 0 additions & 15 deletions dist/cluster/Cluster.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions dist/cluster/ClusterElement.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions dist/cluster/Clusterer.d.ts

This file was deleted.

27 changes: 0 additions & 27 deletions dist/cluster/TreeNode.d.ts

This file was deleted.

20 changes: 0 additions & 20 deletions dist/cluster/UPGMAClusterer.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions dist/color/ColorPalettes.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions dist/metric/EuclidianDistanceMetric.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions dist/metric/Metric.d.ts

This file was deleted.

13 changes: 0 additions & 13 deletions dist/reorder/MoloReorderer.d.ts

This file was deleted.

9 changes: 0 additions & 9 deletions dist/reorder/Reorderer.d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions dist/unipept-visualizations.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/visualizations/heatmap/HeatmapSettings.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Settings from "./../../settings";
import Settings from "./../../Settings";
import HeatmapFeature from "./HeatmapFeature";
import HeatmapValue from "./HeatmapValue";
import Clusterer from "./cluster/Clusterer";
import Reorderer from "./reorder/Reorderer";
export default class HeatmapSettings extends Settings {
/**
* The amount of pixels that can maximally be used for row labels when initially rendering the heatmap.
Expand Down Expand Up @@ -92,6 +94,8 @@ export default class HeatmapSettings extends Settings {
* Color of the lines used to construct a dendrogram (must be a valid HTML color string).
*/
dendrogramColor: string;
clusteringAlgorithm: Clusterer;
reorderer: Reorderer;
/**
* Returns the html to use as tooltip for a cell. Is called with a HeatmapValue that represents the current cell and
* the row and column objects associated with the highlighted cell as parameters. The result of getTooltipTitle is
Expand Down
4 changes: 4 additions & 0 deletions dist/visualizations/heatmap/cluster/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Clusterer from "./Clusterer";
import UPGMAClusterer from "./UPGMAClusterer";
import TreeNode from "./TreeNode";
export { Clusterer, UPGMAClusterer, TreeNode };
3 changes: 3 additions & 0 deletions dist/visualizations/heatmap/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ import HeatmapValue from "./HeatmapValue";
import HeatmapSettings from "./HeatmapSettings";
import HeatmapFeature from "./HeatmapFeature";
export { Heatmap, HeatmapValue, HeatmapFeature, HeatmapSettings };
export * from "./cluster/index";
export * from "./metric/index";
export * from "./reorder/index";
3 changes: 3 additions & 0 deletions dist/visualizations/heatmap/reorder/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Reorderer from "./Reorderer";
import MoloReorderer from "./MoloReorderer";
export { Reorderer, MoloReorderer };

This file was deleted.

4 changes: 2 additions & 2 deletions src/visualizations/heatmap/Heatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ export default class Heatmap {
}

private computeClusterRoots() {
let clusterer = new UPGMAClusterer(new EuclidianDistanceMetric());
let molo: Reorderer = new MoloReorderer();
let clusterer = this.settings.clusteringAlgorithm;
let molo: Reorderer = this.settings.reorderer;

// Create a new ClusterElement for every row that exists. This ClusterElement keeps track of an array of
// numbers that correspond to a row's values.
Expand Down
11 changes: 10 additions & 1 deletion src/visualizations/heatmap/HeatmapSettings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import Settings from "./../../settings";
import Settings from "./../../Settings";
import HeatmapFeature from "./HeatmapFeature";
import HeatmapValue from "./HeatmapValue";
import { Transition } from "./../../transition/Transition";
import Clusterer from "./cluster/Clusterer";
import UPGMAClusterer from "./cluster/UPGMAClusterer";
import EuclidianDistanceMetric from "./metric/EuclidianDistanceMetric";
import MoloReorderer from "./reorder/MoloReorderer";
import Reorderer from "./reorder/Reorderer";

export default class HeatmapSettings extends Settings {
/**
Expand Down Expand Up @@ -114,6 +119,10 @@ export default class HeatmapSettings extends Settings {
*/
dendrogramColor: string = "#404040";

clusteringAlgorithm: Clusterer = new UPGMAClusterer(new EuclidianDistanceMetric());

reorderer: Reorderer = new MoloReorderer();

/**
* Returns the html to use as tooltip for a cell. Is called with a HeatmapValue that represents the current cell and
* the row and column objects associated with the highlighted cell as parameters. The result of getTooltipTitle is
Expand Down
6 changes: 3 additions & 3 deletions src/visualizations/heatmap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import HeatmapSettings from "./HeatmapSettings";
import HeatmapFeature from "./HeatmapFeature";

export { Heatmap, HeatmapValue, HeatmapFeature, HeatmapSettings }
export * from "./cluster";
export * from "./metric";
export * from "./reorder";
export * from "./cluster/index";
export * from "./metric/index";
export * from "./reorder/index";
6 changes: 5 additions & 1 deletion types/visualizations/heatmap/HeatmapSettings.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Settings from "./../../settings";
import Settings from "./../../Settings";
import HeatmapFeature from "./HeatmapFeature";
import HeatmapValue from "./HeatmapValue";
import Clusterer from "./cluster/Clusterer";
import Reorderer from "./reorder/Reorderer";
export default class HeatmapSettings extends Settings {
/**
* The amount of pixels that can maximally be used for row labels when initially rendering the heatmap.
Expand Down Expand Up @@ -92,6 +94,8 @@ export default class HeatmapSettings extends Settings {
* Color of the lines used to construct a dendrogram (must be a valid HTML color string).
*/
dendrogramColor: string;
clusteringAlgorithm: Clusterer;
reorderer: Reorderer;
/**
* Returns the html to use as tooltip for a cell. Is called with a HeatmapValue that represents the current cell and
* the row and column objects associated with the highlighted cell as parameters. The result of getTooltipTitle is
Expand Down
4 changes: 4 additions & 0 deletions types/visualizations/heatmap/cluster/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Clusterer from "./Clusterer";
import UPGMAClusterer from "./UPGMAClusterer";
import TreeNode from "./TreeNode";
export { Clusterer, UPGMAClusterer, TreeNode };
3 changes: 3 additions & 0 deletions types/visualizations/heatmap/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ import HeatmapValue from "./HeatmapValue";
import HeatmapSettings from "./HeatmapSettings";
import HeatmapFeature from "./HeatmapFeature";
export { Heatmap, HeatmapValue, HeatmapFeature, HeatmapSettings };
export * from "./cluster/index";
export * from "./metric/index";
export * from "./reorder/index";
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions types/visualizations/heatmap/reorder/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Reorderer from "./Reorderer";
import MoloReorderer from "./MoloReorderer";
export { Reorderer, MoloReorderer };

0 comments on commit 6eb47b4

Please sign in to comment.