@hopara/react 0.2.5 → 0.3.1

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.
package/README.md CHANGED
@@ -61,9 +61,38 @@ type HoparaProps = {
61
61
 
62
62
  // The initial row (e.g. asset) to load the visualization
63
63
  initialRow: InitialRow | undefined
64
+
65
+ // The custom controller to be used on Hopara Visualization
66
+ controller: HoparaController | undefined
64
67
  }
65
68
  ```
66
69
 
70
+ ### Controller
71
+ You can provide a Hopara Controller to manually trigger a data refresh (i.e. fetch all data again).
72
+
73
+ #### Example
74
+
75
+ ```jsx
76
+ import {Hopara, HoparaController} from '@hopara/react'
77
+ const customController = new HoparaController()
78
+
79
+ ...
80
+
81
+ setInterval(() => {
82
+ customController.refresh()
83
+ }, 3000)
84
+
85
+ ...
86
+
87
+ <div className="HoparaEmbedded">
88
+ <Hopara
89
+ app="your-app-id"
90
+ accessToken="your-access-token"
91
+ controller={customController}
92
+ />
93
+ </div>
94
+ ```
95
+
67
96
  ### Data Loader
68
97
  By default Hopara will load the same visualization and data as seen as in hopara.app. You can use the data loader prop to provide a custom way to load the data.
69
98