Skip to content

Commit 768f904

Browse files
Merge pull request #6 from nasa/GUUI-3596-implement-line-segmenting-in-map-component
Implemented scatter plot graph with pixel interpolation
2 parents 392b6e8 + fe9172e commit 768f904

4 files changed

Lines changed: 344 additions & 457 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/plot-toolbar/plot-toolbar.component.ts

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -202,25 +202,25 @@ export default class TerraPlotToolbar extends TerraElement {
202202
<a
203203
target="_blank"
204204
href="${this.catalogVariable
205-
.dataProductDescriptionUrl}"
205+
.dataProductDescriptionUrl}"
206206
>[${this.catalogVariable
207-
.dataProductShortName}_${this
208-
.catalogVariable.dataProductVersion}]</a
207+
.dataProductShortName}_${this
208+
.catalogVariable.dataProductVersion}]</a
209209
>
210210
${this.showLocation
211-
? html`• ${this.#getLocationIcon()}
211+
? html`• ${this.#getLocationIcon()}
212212
<span
213213
class="location-text"
214214
@mouseenter=${this
215-
.#handleLocationMouseEnter}
215+
.#handleLocationMouseEnter}
216216
@mouseleave=${this
217-
.#handleLocationMouseLeave}
217+
.#handleLocationMouseLeave}
218218
>${this.location.replace(
219-
/,/g,
220-
', '
221-
)}</span
219+
/,/g,
220+
', '
221+
)}</span
222222
>`
223-
: ''}
223+
: ''}
224224
</h3>
225225
</slot>
226226
</div>
@@ -337,12 +337,12 @@ export default class TerraPlotToolbar extends TerraElement {
337337
</terra-button>
338338
339339
${this.dataType == 'geotiff'
340-
? html`
340+
? html`
341341
<terra-button
342342
circle
343343
outline
344344
aria-expanded=${this.activeMenuItem ===
345-
'GeoTIFF'}
345+
'GeoTIFF'}
346346
aria-controls="menu"
347347
aria-haspopup="true"
348348
class="toggle"
@@ -356,7 +356,7 @@ export default class TerraPlotToolbar extends TerraElement {
356356
></terra-icon>
357357
</terra-button>
358358
`
359-
: nothing}
359+
: nothing}
360360
</div>
361361
362362
<menu
@@ -410,7 +410,7 @@ export default class TerraPlotToolbar extends TerraElement {
410410
</menu>
411411
412412
${this.showLocationTooltip
413-
? html`
413+
? html`
414414
<div class="location-tooltip">
415415
<terra-map
416416
.value=${this.locationMapValue}
@@ -423,7 +423,7 @@ export default class TerraPlotToolbar extends TerraElement {
423423
></terra-map>
424424
</div>
425425
`
426-
: ''}
426+
: ''}
427427
</header>`
428428
)
429429
}
@@ -468,13 +468,26 @@ export default class TerraPlotToolbar extends TerraElement {
468468
)
469469
}
470470

471+
#showCheckBoxToggle = (e: Event) => {
472+
const checkbox = e.target as HTMLInputElement;
473+
const isChecked = checkbox.checked;
474+
475+
this.dispatchEvent(
476+
new CustomEvent('show-check-box-toggle', {
477+
detail: isChecked,
478+
bubbles: true,
479+
composed: true,
480+
})
481+
)
482+
}
483+
471484
#renderGeotiffPanel() {
472485
return html`
473486
<h3 class="sr-only">GeoTIFF Settings</h3>
474487
475488
${this.dataType === 'geotiff'
476489
? html`
477-
<p>Select opacity and apply colormaps</p>
490+
<p>Select opacity,apply colormaps, and toggle draw profile</p>
478491
479492
<label>
480493
Layer opacity
@@ -496,16 +509,25 @@ export default class TerraPlotToolbar extends TerraElement {
496509
@change=${this.#onColorMapChange}
497510
>
498511
${this.colormaps.map(
499-
cm =>
500-
html` <option
512+
cm =>
513+
html` <option
501514
value="${cm}"
502515
?selected=${cm === this.colorMapName}
503516
>
504517
${cm}
505518
</option>`
506-
)}
519+
)}
507520
</select>
508521
</label>
522+
<label>
523+
<input
524+
type="checkbox"
525+
@change=${this.#showCheckBoxToggle}
526+
/>
527+
<slot>Draw Profile</slot>
528+
</label>
529+
</label>
530+
509531
`
510532
: nothing}
511533
`
@@ -522,7 +544,7 @@ export default class TerraPlotToolbar extends TerraElement {
522544
<dt>Variable Shortname</dt>
523545
<dd>
524546
${this.catalogVariable.dataFieldShortName ??
525-
this.catalogVariable.dataFieldAccessName}
547+
this.catalogVariable.dataFieldAccessName}
526548
</dd>
527549
528550
<dt>Units</dt>
@@ -700,9 +722,9 @@ export default class TerraPlotToolbar extends TerraElement {
700722
<a
701723
href="#"
702724
@click=${(e: Event) => {
703-
e.preventDefault()
704-
this.#handleJupyterNotebookClick()
705-
}}
725+
e.preventDefault()
726+
this.#handleJupyterNotebookClick()
727+
}}
706728
>
707729
Open in Jupyter Notebook
708730
<terra-icon

0 commit comments

Comments
 (0)