terra_ui_components 0.0.75__py3-none-any.whl → 0.0.76__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of terra_ui_components might be problematic. Click here for more details.

@@ -16,12 +16,12 @@ class TerraBaseWidget(anywidget.AnyWidget):
16
16
  return f"""
17
17
  const terraStyles = document.createElement('link')
18
18
  terraStyles.rel = 'stylesheet'
19
- terraStyles.href = 'https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.75/cdn/themes/horizon.css'
19
+ terraStyles.href = 'https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.76/cdn/themes/horizon.css'
20
20
  //terraStyles.href = "https://localhost:4000/dist/themes/horizon.css"
21
21
  document.head.appendChild(terraStyles)
22
22
 
23
23
  const terraAutoloader = document.createElement('script')
24
- terraAutoloader.src = "https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.75/cdn/terra-ui-components-autoloader.js"
24
+ terraAutoloader.src = "https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.76/cdn/terra-ui-components-autoloader.js"
25
25
  //terraAutoloader.src = "https://localhost:4000/dist/terra-ui-components-autoloader.js"
26
26
  terraAutoloader.type = 'module'
27
27
  document.head.appendChild(terraAutoloader)
@@ -20,7 +20,12 @@ class TerraTimeAverageMap(TerraBaseWidget):
20
20
  *
21
21
  * model.get() pulls from the Jupyter notebooks state. We'll use the state to set the initial value for each property
22
22
  */
23
- component.attr = model.get('attr')
23
+ component.collection = model.get('collection')
24
+ component.variable = model.get('variable')
25
+ component.startDate = model.get('startDate')
26
+ component.endDate = model.get('endDate')
27
+ component.location = model.get('location')
28
+ component.long_name = model.get('long_name')
24
29
 
25
30
  /**
26
31
  * add the component to the cell
@@ -36,8 +41,41 @@ class TerraTimeAverageMap(TerraBaseWidget):
36
41
  *
37
42
  * If this isn't here, the component can't be changed after it's initial render
38
43
  */
39
- model.on('change:attr', () => {
40
- component.attr = model.get('attr')
44
+ model.on('change:collection', () => {
45
+ component.collection = model.get('collection')
46
+ })
47
+ model.on('change:variable', () => {
48
+ component.variable = model.get('variable')
49
+ })
50
+ model.on('change:startDate', () => {
51
+ component.startDate = model.get('startDate')
52
+ })
53
+ model.on('change:endDate', () => {
54
+ component.endDate = model.get('endDate')
55
+ })
56
+ model.on('change:location', () => {
57
+ component.location = model.get('location')
58
+ })
59
+ model.on('change:long_name', () => {
60
+ component.long_name = model.get('long_name')
61
+ })
62
+
63
+ /**
64
+ * Add event listeners.
65
+ * These are used to communicate back to the Jupyter notebook
66
+ */
67
+ component.addEventListener('terra-time-average-map-data-change', (e) => {
68
+ // hide the loading overlay, if it exists
69
+ const loadingOverlay = document.getElementById('jupyterlite-loading-overlay')
70
+
71
+ if (loadingOverlay) {
72
+ loadingOverlay.remove()
73
+ }
74
+
75
+ console.log('caught the event!! ', e)
76
+
77
+ model.set('data', e.detail.data.data)
78
+ model.save_changes()
41
79
  })
42
80
  }
43
81
 
@@ -45,6 +83,13 @@ class TerraTimeAverageMap(TerraBaseWidget):
45
83
  """
46
84
 
47
85
  # Component properties
48
- # While we have properties in the component, we also need to tell Python about them as well.
86
+ # While we have properties in the component, we also need to tell Python about them as well.
49
87
  # Again, you don't technically need all these. If Jupyter Notebooks don't need access to them, you can remove them from here
50
- attr = traitlets.Unicode('').tag(sync=True)
88
+ collection = traitlets.Unicode('').tag(sync=True)
89
+ variable = traitlets.Unicode('').tag(sync=True)
90
+ startDate = traitlets.Unicode('').tag(sync=True)
91
+ endDate = traitlets.Unicode('').tag(sync=True)
92
+ location = traitlets.Unicode('').tag(sync=True)
93
+ long_name = traitlets.Unicode('').tag(sync=True)
94
+ data = traitlets.List(trait=traitlets.Dict(),
95
+ default_value=[]).tag(sync=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: terra_ui_components
3
- Version: 0.0.75
3
+ Version: 0.0.76
4
4
  Summary: NASA Terra UI Components Library
5
5
  License-File: LICENSE.md
6
6
  Requires-Python: >=3.8
@@ -1,6 +1,6 @@
1
1
  terra_ui_components/README.md,sha256=lBRXP8aio8W0AqDiXL9hkgGlPKfPTELiXZflujVT6BY,198
2
2
  terra_ui_components/__init__.py,sha256=Af9Hf6jOQBv2IBFJX8ZUVTKmzpAKCcz0oT3XIF7yCN8,757
3
- terra_ui_components/base.py,sha256=eKJDJehIxY7Jk4cr0sBi2A3C1auP6dfEjq2gzNY4WTM,1224
3
+ terra_ui_components/base.py,sha256=71u2Ir8yIDcTq91ql7L4fk5jJrRlVFpX8VHPrjpsN1c,1224
4
4
  terra_ui_components/accordion/__init__.py,sha256=xruOtrVmmzFKacs2B_lKpEnDh2PbBq-HUKCdceRNboU,67
5
5
  terra_ui_components/accordion/accordion.py,sha256=3duUmiJ5DTMYfzMJmra8pt0CXXcOkcbY-aAb7-PVCIs,1789
6
6
  terra_ui_components/browse_variables/__init__.py,sha256=JfrTDLSbAecttohBx_OuEC1qT-LoqGO4egStvlJY1Os,86
@@ -22,12 +22,12 @@ terra_ui_components/login/login.py,sha256=kptEtzINeQByhL3TtQLncHoU3rYDUbRuoveuMJ
22
22
  terra_ui_components/plot_toolbar/__init__.py,sha256=rlk9bxXuNo75bIfZu91dDJupiFVOUpPzuUrMJZ5318E,74
23
23
  terra_ui_components/plot_toolbar/plot_toolbar.py,sha256=VCKKZi3hD0qDAG6-exoU1hasWyG4r3A2yPo3TQ8PVoI,1797
24
24
  terra_ui_components/time_average_map/__init__.py,sha256=l3UBuLYIj-5-HQcugO8pRtTynkhLTD1ZlxM_Gf84t5o,84
25
- terra_ui_components/time_average_map/time_average_map.py,sha256=A03mF9owdgFORvmBbhpj3ajUokAI9O8243QO6swF58A,1808
25
+ terra_ui_components/time_average_map/time_average_map.py,sha256=r-yK4Gh2vEL9tVQE6t6gBisa0pWTjyvodKjmOK-wu_Q,3611
26
26
  terra_ui_components/time_series/__init__.py,sha256=uXQun39vOajxJjfOIPC4W-909Sb8QpIwatr86B8iDMA,71
27
27
  terra_ui_components/time_series/time_series.py,sha256=M29nbYf-wmsxyu7WgeQu-pejF598zXuBd9MwAEIW704,3833
28
28
  terra_ui_components/variable_keyword_search/__init__.py,sha256=yjNToGluREKDD4UbkIOROSdlCC4jO6sgHA741OEwVdk,107
29
29
  terra_ui_components/variable_keyword_search/variable_keyword_search.py,sha256=D_jT-FAu0fubKsC0ttK_XF80ExehLnwLyvSLpVVik_o,3677
30
- terra_ui_components-0.0.75.dist-info/METADATA,sha256=EzKQ1V7EpUyO-gT0MTtnxi4fxLXn6SJOvQnd70rTt7M,3090
31
- terra_ui_components-0.0.75.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
- terra_ui_components-0.0.75.dist-info/licenses/LICENSE.md,sha256=rJ_6y_yHe29CU6SBs8DtutDAGaw1BqO1FBWzNvSgwFQ,1065
33
- terra_ui_components-0.0.75.dist-info/RECORD,,
30
+ terra_ui_components-0.0.76.dist-info/METADATA,sha256=L-xFG0WLIeMDeZgqWK-oVP_eFpTFXL9Hz1HJyISihko,3090
31
+ terra_ui_components-0.0.76.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
+ terra_ui_components-0.0.76.dist-info/licenses/LICENSE.md,sha256=rJ_6y_yHe29CU6SBs8DtutDAGaw1BqO1FBWzNvSgwFQ,1065
33
+ terra_ui_components-0.0.76.dist-info/RECORD,,