Explore the weather in other cities with DarkSky Maps. This simple example shows how easy it is to get started with AnalystBoxFrontend!
Follow along to get the demo up and running!
-
Navigate to frontend
$ cd path_to/darksky/frontend
-
Install dependencies
$ npm ci
-
Run
$ npm run start
Here's what to look for in App.js:
// ...
<AnalystBox
questions={this.cities.map((city) => `show me ${city}`)}
onQuestionSelect={({ questionIndex }) => {
const [latitude, longitude] = this.latitudelongitudes[questionIndex];
this.setState({ latitude, longitude });
}}
keywords={this.cities}
searchOptions={{
maxResults: 6,
engines: {
triePrefixSearch: { shouldCache: false },
linearSubstringSearch: {},
},
}}
/>
// ...