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

@sensecare/shang-hai-map

v1.0.3

Published

shangHaiMap

Downloads

4

Readme

通路详情图

  • 基于Echrets封装的上海地图

image.png

/**
 * 上海地图
 * @param {string} id 当前选中容器
 * @param {*} config 自定义配置项
 * @param {Function} onMouseOver 鼠标进入地图事件
 * @param {Function} onMouseOut 鼠标离开地图事件
 * @param {Function} tooltipCallback 用于返回需要展示的文案
 * @param {*} chartMap 当前图表实例组合
 * @param {*} clear 清空画布
 */

  import { initShangHaiMap } from '~'
  const chartMap = new Map();
  const imgFillEle= new Image(20,20); // 地图表面填充图
  imgFillEle.src = mapFillImg;

  const config = {
    imgFillEle:'',  // 地图贴图 HTMLImageElement类型,存在则优先展示贴图,不存在使用 mapColor 和 hoverMapColor
    mapColor:'#455b7a', // 地图颜色 *必填项
    hoverMapColor:'#35455d', // hover状态地图颜色 *必填项
    borderColor:'#fff', // 地图边框颜色 默认 #fff
    hoverBorderColor:'#000', // hover状态地图边框颜色  默认 #fff
    fontSize: 12, // 展示文字字体大小 默认12px
    hoverFontSize: 14, // hover状态 展示文字字体大小 默认12px
    fontColor:'#eee', // 展示文字颜色 默认 #eee
    hoverFontColor:'#fff', // 展示文字颜色 默认 #fff
    showTooltip:true, // 是否显示tooltip框 默认false
    tooltipBorderColor:'#BBDCEC', // tooltip边框颜色 默认 #BBDCEC
    tooltipBorderWidth: 1, // tooltip边框宽度 默认 1px
    tooltipColor: 'red', // tooltip文字颜色 默认 #fff
    // tooltipBgc: '#fff', // tooltip文案提示框背景颜色 默认 #fff
  } 
  // 鼠标进入地图事件
  const onMouseOver = (event)=>{
    console.log(event);
  }
  // 鼠标移除地图事件
  const onMouseOut = (event)=>{
    console.log(event);
  }
    // tooltipCallback 用于返回需要展示的文案
  const tooltipCallback = (params)=>{
    return `<span style="color:${config.tooltipColor};fontSize:20px;padding:8px 12px;">${params.name} - tooltipCallback</span>`;
  }
  // 初始化上海地图
  initShangHaiMap({ id:'shanghaiMap',chartMap,onMouseOver,onMouseOut,tooltipCallback,config })