intia-theme 0.1.64 → 0.1.65

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/_sass/_radar.scss +2 -1
  3. data/assets/js/radar.js +80 -7
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36f9927c2d30d0febbc145d1df8275c78bf5097b59952e912de8d1b44aab7b3a
4
- data.tar.gz: 4efedd31105a649be4c1319e2a316acac9fd2d8fa2fd292e9027ab7de1213e68
3
+ metadata.gz: d5d323ddb6b3bcf99ad7857a29b711a13c2007aa0dcabeeb1e866bd09bb88745
4
+ data.tar.gz: 23f366236d0f75aeaa6402068549f34abf7515dee1b85351f73ee3d24f1790e9
5
5
  SHA512:
6
- metadata.gz: ac6f65dde41dead07bf4e9e877687e2039685ef2df32e3b790b5e26cf742cd479eb7cdf2e871a356569e455e78bb2579caa3c86b2fd6daed194a19b7f59b4ca5
7
- data.tar.gz: ebdc0b7851d92efb3d8e330dfa5bfe40307b1b1c49fba9090ed04f891a28df66278f53b8a8000f3277b5c96c8cda96a0b4d922dbbd2c765a12411917e6228ee7
6
+ metadata.gz: '01950484992fb6e3d6eaac2876c82c5fe2e05b8e7df62e8dd79fe958089be2065c698e7e39a5f1236e279e2b72276b0b3b168727ed14c195ac301bbef9531d00'
7
+ data.tar.gz: b55d6fd45227ee7fa6958d63b3aa2b2f98047c299a6b2573642f4d76a9a4aee671dd8f66d72e9f1d7951a67efcf05fc0bd079b8b16bbb5b2d1b185767f8856ff
data/_sass/_radar.scss CHANGED
@@ -144,6 +144,7 @@
144
144
  position: relative;
145
145
  border-radius: var(--borderRadius);
146
146
  padding: var(--textPadding);
147
+ max-width: 300px;
147
148
  cursor: pointer;
148
149
  }
149
150
  .radarContainer .cardItem:hover{
@@ -260,7 +261,7 @@
260
261
  }
261
262
  .radarLegend .stateColor{
262
263
  position: absolute;
263
- top: 25%;
264
+ top: 35%;
264
265
  width: var(--radarLegendCardItemText);
265
266
  height: var(--radarLegendCardItemText);
266
267
  border-radius: 50%;
data/assets/js/radar.js CHANGED
@@ -220,11 +220,11 @@ function createRadar(config, structure, entries){
220
220
  let color = (blip.stateID >= 0 && blip.stateID < structure.entryStates.list.length)
221
221
  ? d3.rgb(structure.entryStates.list[blip.stateID].color)
222
222
  : d3.rgb(config.blip.defaultColor);
223
- if(blip.moved != 0) color.opacity = 0.25;
223
+ if(false) color.opacity = 0.25; //blip.moved != 0
224
224
  return color;
225
225
  }
226
226
  let getBlipMovedIndicator = (blip) => {
227
- if(blip.moved != 0){
227
+ if(false){ // blip.moved != 0
228
228
  let radius = config.blip.outerCircleRadius;
229
229
 
230
230
  let startAngle = (blip.moved > 0)
@@ -391,7 +391,7 @@ function createRadar(config, structure, entries){
391
391
  blipRadius = blipSize * 0.5,
392
392
  strokeWidth = blipRadius * 0.2,
393
393
  outerCircleRadius = blipRadius ,
394
- innerCircleRadius = outerCircleRadius - strokeWidth;
394
+ innerCircleRadius = outerCircleRadius;
395
395
  config.blip = ({
396
396
  ...config.blip,
397
397
  fontSize: fontSize,
@@ -416,13 +416,20 @@ function createRadar(config, structure, entries){
416
416
  .classed(`radarTitle`, true)
417
417
  .text(config.radar.name);
418
418
  }
419
+ // Select sector buttons
420
+ radarDiv.append('div')
421
+ .attr(`id`, `${radarId}_selectionDropdown`)
422
+ .classed(`buttons`, true);
423
+
419
424
  // select sector dropdown
425
+ /*
420
426
  radarDiv.append(`div`)
421
427
  .attr(`id`, `${radarId}_selectionDropdown`)
422
- .classed(`radarSelection dropdown`, true);
428
+ .classed(`radarSelection dropdown`, true);
429
+ */
423
430
  radarDiv.append(`div`)
424
431
  .classed(`radar`, true)
425
- .attr(`id`, `${radarId}_radarDiv`);
432
+ .attr(`id`, `${radarId}_radarDiv`);
426
433
  /*
427
434
  radarDiv.append(`div`)
428
435
  .classed(`radarBlipLegend`, true);
@@ -441,7 +448,10 @@ function createRadar(config, structure, entries){
441
448
  radarDiv.select(`svg#${radarId}_svg`).append(`g`)
442
449
  .attr(`id`, `${radarId}_radarContent`)
443
450
  .attr(`transform`, translate(radius, radius));
451
+
452
+ // See below for variante without dropdown
444
453
  // append radar legend div
454
+ /*
445
455
  radarDiv.select(`.radar`)
446
456
  .append(`div`)
447
457
  .attr(`id`, `${radarId}_radarLegend`)
@@ -449,6 +459,7 @@ function createRadar(config, structure, entries){
449
459
  .on(`click`, ()=>
450
460
  document.getElementById(`${radarId}_radarLegend`).classList.toggle(`active`))
451
461
  .text(config.radar.legendDropdownText);
462
+ */
452
463
  //#endregion ________________________________________________________________________
453
464
 
454
465
  // can be declared only after the radar svg is appended
@@ -514,7 +525,7 @@ function createRadar(config, structure, entries){
514
525
  let blipClick = (blip) => {
515
526
  let blipData = radarData.blips.find(data => data.id == blip.id);
516
527
  if (blipData.focused){
517
- window.open(blipData.link);
528
+ window.open(config.radar.linkPrefix + blipData.link + config.radar.linkSuffix);
518
529
  }
519
530
  else blipData.focused = true;
520
531
  }
@@ -743,6 +754,34 @@ function createRadar(config, structure, entries){
743
754
  //#endregion ------------------------------------------------------------------------
744
755
 
745
756
  //#region generate selection ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
757
+
758
+ radarDiv.select(`.buttons`)
759
+ .append('a')
760
+ .classed('button',true)
761
+ .classed('is-rounded',true)
762
+ .classed('is-dark',true)
763
+ .text(config.radar.showAllSectorsText)
764
+ .on(`click`, () => {
765
+ displayAllSectors();
766
+ changeSvgViewbox(`${radarId}_radarContent`);
767
+ selectionDropdownText.text(config.radar.showAllSectorsText);
768
+ });
769
+ radarDiv.select(`.buttons`)
770
+ .selectAll(null)
771
+ .data(radarData.sectors)
772
+ .enter()
773
+ .append(`a`)
774
+ .classed('button',true)
775
+ .classed('is-rounded',true)
776
+ .classed('is-dark',true)
777
+ .text(sector => sector.name)
778
+ .on(`click`, sector => {
779
+ displaySector(sector);
780
+ changeSvgViewbox(sector.idText);
781
+ selectionDropdownText.text(sector.name);
782
+ });
783
+
784
+
746
785
  let selectionDropdownText = radarDiv.select(`.radarSelection`)
747
786
  .on(`click`, ()=> {
748
787
  document.getElementById(`${radarId}_selectionDropdown`)
@@ -780,7 +819,9 @@ function createRadar(config, structure, entries){
780
819
  displaySector(sector);
781
820
  changeSvgViewbox(sector.idText);
782
821
  selectionDropdownText.text(sector.name);
783
- });
822
+ });
823
+
824
+
784
825
  //#endregion ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
785
826
 
786
827
  //#region generate radar ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -809,6 +850,37 @@ function createRadar(config, structure, entries){
809
850
  //#endregion ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
810
851
 
811
852
  //#region generate radar legend +++++++++++++++++++++++++++++++++++++++++++++++++++++
853
+ // Legend without dropdown
854
+ radarDiv.select(`.radar`)
855
+ .append(`div`)
856
+ .attr(`id`, `${radarId}_radarLegend`)
857
+ .classed(`radarLegend`, true)
858
+ .text(config.radar.legendDropdownText);
859
+
860
+ let radarLegendContainer = radarDiv.select(`.radarLegend`)
861
+ .selectAll(null)
862
+ .data(structure.entryStates.list)
863
+ .enter()
864
+ .append(`div`)
865
+ .classed(`cardItem`, true)
866
+ .call(makeLegendBlipStates)
867
+ .on(`mouseover`, (data)=> focusBlipByState(data))
868
+ .on(`mouseout`, data => focusAllBlips(data));
869
+
870
+
871
+ let ringLegend = radarDiv.select(`.radar`).append(`div`)
872
+ ringLegend.append(`div`)
873
+ .classed(`radarLegend`, true)
874
+ .text(structure.rings.legendTitle);
875
+ ringLegend.selectAll(null)
876
+ .data(radarData.rings)
877
+ .enter()
878
+ .append(`div`)
879
+ .classed(`cardItem`, true)
880
+ .call(makeLegendRings)
881
+ .on(`mouseover`, (data)=> focusRing(data))
882
+ .on(`mouseout`, ()=> focusAllRings());
883
+ /*
812
884
  let radarLegendContainer = radarDiv.select(`.radarLegend`)
813
885
  .append(`div`)
814
886
  .attr(`id`, `${radarId}_radarLegendContainer`)
@@ -858,6 +930,7 @@ function createRadar(config, structure, entries){
858
930
  .call(makeLegendRings)
859
931
  .on(`mouseover`, (data)=> focusRing(data))
860
932
  .on(`mouseout`, ()=> focusAllRings());
933
+ */
861
934
  //#endregion ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
862
935
 
863
936
  //#region generate radar blip legend ++++++++++++++++++++++++++++++++++++++++++++++++
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intia-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.64
4
+ version: 0.1.65
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Schmidt