npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@txdot-gis/txdot-toolbox-js

v1.0.4

Published

Shared processing and web map functions for TxDOT applications

Downloads

7

Readme

txdot-toolbox-js

Shared processing and web map JS functions for TxDOT applications alongside shared styling properties

Overview

TxDOT uses a variety of shared functionality and styling across web applications and sites. This package serves as a toolbox with these JS functions and CSS styling properties for easy import and use.
The styling properties are created both from classic CSS and modern SCSS but unique and are not duplicated in either. They are each organized in their respective folders src/style/css and src/style/scss. Individual files in each folder are recognized via import in their folder's _index.scss file.
The JS tools available in this package are organized by subfolder under the primary package variable txdotToolbox. Call them via dot notation from the package variable. Their specific argument requirement documentation can be found in their specific function file (i.e. src/<subfolder>/<function file>.js).
They include:

└── txdotToolbox
    └── spm
        ├── jumpToGoogle(lat, lon, level)
        ├── jumpToGoogleEsri(mapView)
        ├── jumpToSpm(lat, lon, level, points, routes)
        ├── jumpToSpmEsri(mapView, points, routes)
        └── jumpToSrd(routeId, beginDfo, endDfo, attributes)

Usage

Install

npm install @txdot-gis/txdot-toolbox-js --save

Basic ES6 Usage

import '@txdot-gis/txdot-toolbox-js/dist/main.css' // to make styling available, import main.css in entry .js file

...

<div id='scss-example'>
	<button type='button' className='background text'>SCSS Example</button>
</div>
<div>
	<button type='button' className='css-example'>CSS Example</button>
</div>
import txdotToolbox from '@txdot-gis/txdot-toolbox-js' // all JS functions available under txdotToolbox variable

...

const latitude = 29.212940817521442
const longitude = -103.28362089838606
const zoomLevel = 9

txdotToolbox.spm.jumpToGoogle(latitude, longitude, zoomLevel)

Basic CDN Usage

Notice CDN requires accessing the JS package subfolders via default

<head>
	<link rel="stylesheet" href="https://unpkg.com/@txdot-gis/txdot-toolbox-js@latest/dist/main.css" /> <!-- source CSS -->
	<script src="https://unpkg.com/@txdot-gis/txdot-toolbox-js@latest/dist/index.js"></script> <!-- source JS -->
	
	<script >
		const latitude = 29.212940817521442
		const longitude = -103.28362089838606
		const zoomLevel = 9

		const jumpGoogleListener = document.querySelector('#jumpToGoogle')
		jumpGoogleListener.addEventListener('click', (event) => {
			txdotToolbox.default.spm.jumpToGoogle(latitude, longitude, zoomLevel)
		})
	</script>
</head>
<body>
	<div id='scss-example'>
		<button type='button' class='background text'>SCSS Example</button>
	</div>
	<div>
		<button type='button' class='css-example'>CSS Example</button>
	</div>
	<br>
	<button type="button" id="jumpToGoogle">Jump To Google</button>
</body>