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

@ray-js/robot-map-component

v0.0.17

Published

扫地机地图智能小程序组件

Downloads

1,013

Readme

English | 简体中文

@ray-js/robot-map-component

latest download

Smart program component for robot vacuum cleaner maps

1. Installation

$ npm install @ray-js/robot-map-component
// or
$ yarn add @ray-js/robot-map-component

2. Usage

Tuya MiniApp Tools >= 0.5.10
Basic Lib >= 2.15.0
Tuya App Basic Line > 5.8.0

yarn add @ray-js/robot-map-component

Import the full-screen component in your project

import React from 'react';
import { View } from '@ray-js/ray';
import { IndoorMap } from '@ray-js/robot-map-component';
import styles from './index.module.less';

export default function Home() {
  return (
    <View className={styles.view}>
      <IndoorMap.Full />
    </View>
  );
}

Import the dynamic width and height component in your project

import React from 'react';
import { View } from '@ray-js/ray';
import { IndoorMap } from '@ray-js/robot-map-component';
import styles from './index.module.less';

export default function Home() {
  return (
    <View className={styles.view}>
      <IndoorMap.Dynamic />
    </View>
  );
}

3. Parameter Description

| Property | Description | Type | Default Value | Remarks | | | | | | | --------------------- | ------------------------------------------------------------------------------- | ----------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | --- | --- | --- | | is3d | Whether it is a 3D map | boolean | false | Public version usage; developers can ignore | | | | | | | style | Styles for the container wrapping the map | ViewStyle | {} | Supported only by dynamic map components | | | | | | | className | Class name for the container wrapping the map | string | '' | Supported only by dynamic map components | | | | | | | configurationData | Map-related configuration options | ConfigurationData | | Static property configuration options | | | | | | | runtimeData | Map-related configuration options | -- | | Dynamic property configuration options | | | | | | | mapDataHex | Original map data reported by the device | string | | Map data reported via P2P channel | | | | | | | pathDataHex | Original path data reported by the device | string | | Path data reported via P2P channel | | | | | | | componentBackground | Background color of the outer container wrapping the map | string | transparent | Generally does not require modification | | | | | | | initUseThread | Whether to use multithreading during initialization | boolean | false | It is recommended not to modify; this allows you to achieve faster initial loading | | | | | | | resourceUsageLevel | Resource usage limit for the map | 'high' | 'low' | high | It is recommended not to modify | | | | | | | isFreezeMap | Whether to freeze the map | boolean | false | isFreezeMap will automatically listen in environments with navigation and stop rendering your map to save performance. Setting isFreezeMap to true in components like pop-ups may cause uncontrolled errors. | | | | | | | onLaserMapPoints | Callback for virtual wall and forbidden area data during movement and operation | Function | | | | | | | | | onMapId | Callback during map initialization | Function | | This callback cannot guarantee that all map elements have been fully loaded | | | | | | | onDecodeMapData | Callback function after map data parsing completes | Function | | | | | | | | | onDecodePathData | Callback function after path data parsing completes | Function | | | | | | | | | onMapLoadEnd | Callback after map initialization completes | Function | | This callback cannot guarantee that all map elements have been fully loaded | | | | | | | onVirtualInfoRendered | Callback after rendering virtual data boxes | Function | | | | | | | |

3.1 ConfigurationData Map Style Configuration Options

Map-related configuration data

| Property | Description | Type | Default Value | Remarks | | | | | | | --------------------- | ------------------------------------------------ | ------- | ------------- | -------------------------------------------------- | --- | --- | --- | --- | --- | | mapId | Unique identifier for the map component | string | | | | | | | | | staticPrefix | Host address for static resources | string | | For public version use only; developers can ignore | | | | | | | asynchronousLoadMap | Whether to use asynchronous rendering for layers | boolean | false | | | | | | | | isRotate | Whether the forbidden area box supports rotation | boolean | | | | | | | | | maxRoomPropertyLength | Maximum length of room attributes supported | number | 3 | | | | | | | | markerIcon | Robot vacuum cleaner icon | Object | | | | | | | | | factorInfo | Information for displaying meters | Object | | | | | | | | | appointIcon | Icon for designating cleaning areas | string | | Supports base64 images or online images | | | | | | | mergeRoomParams | Configuration related to room merging | | | | | | | | | | minAreaWidth | Default minimum size for virtual areas | number | | | | | | | | | pathWidth | Path width | number | | | | | | | | | pilePosition | Configuration related to charging piles | Object | | | | | | | | | posParams | Configuration related to point cleaning | Object | | | | | | | | | robotParams | Configuration related to the robot vacuum | Object | | | | | | | | | roomStyleConfig | Configuration related to room names | Object | | | | | | | | | roomAttributesConfig | Room cleaning attributes | Object | | | | | | | | | pathConfig | Configuration related to paths | Object | | | | | | | |