How to use the @mapbox/batfish/data/examples.filter function in @mapbox/batfish

To help you get started, we’ve selected a few @mapbox/batfish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / mapbox-gl-js / docs / pages / examples.js View on Github external
const renderedCardContainers = Object.keys(tags).map((topic) => {
            const cardsForTopic = examples
                .filter(example => example.tags.indexOf(topic) > -1)
                .map((example, index) => {
                    const filename = example.pathname.split('/')[3];
                    return (
                        
                            }
github mapbox / mapbox-gl-js / docs / components / page_shell.js View on Github external
Object.keys(data).map((topic) => {
                const subNavItems = examples
                    .filter(item => item.tags[0] === topic)
                    .map(item => ({
                        text: item.title,
                        description: item.description,
                        url: item.path,
                        active: this.props.location.pathname === item.path
                    }));
                return {
                    title: data[topic],
                    url: `/mapbox-gl-js/examples/#${topic}`,
                    items: subNavItems
                };
            }).filter(topic => topic.items.length > 0)
        );