Browse Source

fix: Hide Adjuster panel when not active

jmacura 5 years ago
parent
commit
d1cdee0619
2 changed files with 3 additions and 2 deletions
  1. 1 1
      src/adjuster/adjuster.directive.html
  2. 2 1
      src/app.service.ts

+ 1 - 1
src/adjuster/adjuster.directive.html

@@ -1,4 +1,4 @@
-<div class="card card-default mainpanel">
+<div [hidden]="!isVisible()" class="card mainpanel">
   <hs-panel-header panel-name="adjuster" panel-title="'Adjust factors'"></hs-panel-header>
   <hs-panel-header panel-name="adjuster" panel-title="'Adjust factors'"></hs-panel-header>
   <div class="card-body">
   <div class="card-body">
     <div class="p-2 center-block">
     <div class="p-2 center-block">

+ 2 - 1
src/app.service.ts

@@ -138,10 +138,11 @@ export class AppService {
   /**
   /**
    * https://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/
    * https://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/
    * @private
    * @private
+   * @description Only generates random colors if the current palette does not provide enough colors for all the clusters
    * @param {number} colorCount Number of colors to randomly generate
    * @param {number} colorCount Number of colors to randomly generate
    * @returns {Array<Array<Number>>} Array of RGB colors
    * @returns {Array<Array<Number>>} Array of RGB colors
    */
    */
-  private generateRandomColorPalette(colorCount) {
+  private generateRandomColorPalette(colorCount: number) {
     const palette = this.colorPalette;
     const palette = this.colorPalette;
     const goldenRatioConjugate = 0.618033988749895;
     const goldenRatioConjugate = 0.618033988749895;
     let i = palette.length;
     let i = palette.length;