Skip to content

Commit

Permalink
Merge pull request #20 from ruralinnovation/development
Browse files Browse the repository at this point in the history
rebuild api context
  • Loading branch information
tech-team-rural-mda authored Aug 6, 2024
2 parents ec716c3 + efc5c40 commit 31cef89
Show file tree
Hide file tree
Showing 20 changed files with 392 additions and 91 deletions.
36 changes: 32 additions & 4 deletions inst/dist/@cori-risi/components/CategoricalLegend.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
import React from 'react';
interface CategoricalLegendProps {
/**
* This is a prototype generalization of the CategoricalLegend component used in the
* [ERC tool](https://github.com/ruralinnovation/erc-frontend-ts/tree/dev/MDAT-30-frontend-ui-shared-library/src/components){target=_blank}
*
* ```ts
* import { CategoricalLegend } from '@cori-risi/cori.data.api';
*
* import "@cori-risi/cori.data.api/inst/dist/cori.data.api.css";
*
* // ...
*
* const colorScale = d3.scaleOrdinal<string>()
* .domain(groups) // Input domain
* .range(["#A3E2B5", "#00835D", "#26535C"]);
*
* const colorScaleDomain = colorScale.domain();
* const colorScaleRange = colorScale.range();
*
* // ...
*
* <CategoricalLegend domain_names={colorScaleDomain.map(c => data.filter(d => d.geoid === c).map(d => d.name)[0])}
* domain={colorScaleDomain}
* range={colorScaleRange} />
* ```
*
* @param props.domain_names - an (array) of names, each one mapped to a category in the color scale domain
* @param props.domain - d3 color scale domain
* @param props.range - d3 color scale range
*/
declare function CategoricalLegend(props: {
domain_names?: string[] | undefined;
domain?: string[] | undefined;
range?: unknown[] | undefined;
scale?: any | undefined;
na_message?: string;
title?: string;
}
declare function CategoricalLegend({ domain, domain_names, range, title, scale, na_message }: CategoricalLegendProps): React.JSX.Element;
na_message?: string;
}): React.JSX.Element;
export default CategoricalLegend;
//# sourceMappingURL=CategoricalLegend.d.ts.map
2 changes: 1 addition & 1 deletion inst/dist/@cori-risi/components/CategoricalLegend.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 31 additions & 1 deletion inst/dist/@cori-risi/components/CategoricalLegend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion inst/dist/@cori-risi/components/CategoricalLegend.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 30 additions & 9 deletions inst/dist/@cori-risi/components/GeocoderControl.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
import { MarkerProps, ControlPosition } from 'react-map-gl';
import { GeocoderOptions } from '@mapbox/mapbox-gl-geocoder';
type GeocoderControlProps = Omit<GeocoderOptions, 'accessToken' | 'mapboxgl' | 'marker'> & {
/**
* This is a Geocoder search component that can be added to any `react-map-gl` Map component.
*
* ```ts
* import mapboxgl from 'mapbox-gl';
* import Map, { Source, Layer } from 'react-map-gl';
*
* import { GeocoderControl } from "@cori-risi/cori.data.api";
*
* import "mapbox-gl/dist/mapbox-gl.css";
*
* mapboxgl.accessToken = import.meta.env.VITE_MAPBOX_ACCESS_TOKEN;
*
* // ...
*
* <Map mapboxAccessToken={MAPBOX_TOKEN}
* {...} >
* <Source {...} >
* <Layer {...} /> :
* </Source>
* <GeocoderControl mapboxAccessToken={MAPBOX_TOKEN} position="top-left" />
* </Map>
* ```
*
* @param props.mapboxAccessToken - Mapbox API token
* @param props.marker - `true` or `false` to place marker on result once selected (default: `false`)
* @param props.position - CSS class to position control in "top-left", "top-right", "bottom-left" or "bottom-right" of the map pane
*/
export default function GeocoderControl(props: {
mapboxAccessToken: string;
marker?: boolean | Omit<MarkerProps, 'longitude' | 'latitude'>;
position: ControlPosition;
onLoading?: (e: object) => void;
onResults?: (e: object) => void;
onResult?: (e: object) => void;
onError?: (e: object) => void;
};
export default function GeocoderControl(props: GeocoderControlProps): null;
export {};
}): null;
//# sourceMappingURL=GeocoderControl.d.ts.map
2 changes: 1 addition & 1 deletion inst/dist/@cori-risi/components/GeocoderControl.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 31cef89

Please sign in to comment.