机械制图国家标准的绘图模板

JS Charting comes integrated with geographic mapping support, including optimized data files for all country, province and state maps without the need of a separate product or add-on. What's more interesting is that the API for mapping is the same as that used for regular charts, enabling users to leverage the existing experience to create new map charts quickly and easily. In this tutorial, we will set up a multi-step thematic map bound to real-world data from a live source.

JS Charting与地理地图支持集成在一起,包括针对所有国家,省和州地图的优化数据文件,而无需单独的产品或附加组件。 更有趣的是,用于映射的API与用于常规图表的API相同,从而使用户能够利用现有的经验快速轻松地创建新的地图。 在本教程中,我们将建立一个多步骤的专题图,该专题图绑定到实时源中的真实数据。

See the Pen by Arthur Puszynski (@jsblog) on CodePen.

看笔 由Arthur Puszynski( @jsblog )在CodePen上编写 。

To enable charting in the page, jQuery and the JSCharting scripts are added.

为了在页面中启用图表,添加了jQuery和JSCharting脚本。


<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="JSC/JSCharting.js"></script>

Then a div element is placed in HTML to host the chart visual.

然后,将div元素放置在HTML中,以托管图表外观。


<div id="mainChart"></div>

To draw a chart the jquery plugin API can be used to bind chart options to a the div and takes the following form:

要绘制图表,可以使用jquery插件API将图表选项绑定到div并采用以下形式:


$('#mainChart').JSC({/*chart options*/});

基础 (The Basics)

In traditional mapping, the concept of map layers are used to construct maps and JSCharting is similar, however, regular series and points are used for this purpose. Chart series are equivalent to map layers and points represent the shapes within those layers. To render a map layer of the United States the chart options define the type of chart as map, and a series with a map code:

在传统制图中,使用地图图层的概念来构造地图,并且JSCharting与此类似,但是为此使用了常规的序列和点。 图表系列等效于地图图层,点表示这些图层内的形状。 要呈现美国的地图图层,图表选项将图表的类型定义为地图,以及一系列包含地图代码的代码:


{
type:'map',
series:[{
map:'us'
}]
}

For a reference of the included map areas, see the interactive mapping browser.

有关所包含地图区域的参考,请参见交互式地图浏览器 。

Because a series is used, the points of the series become states within the US map. Alternatively, if we only wanted the outline of the US, we would add a series with a point map property set to US.

因为使用了序列,所以序列的点成为美国地图内的州。 另外,如果我们只想要美国的轮廓,则可以添加一个将点地图属性设置为美国的系列。


{
type:'map',
series:[{
points:[{
map:'us'
}]
}]
}

Returning to the first example, where we use a series of the United States, points are generated internally. In order to customize the individual map layer shapes of a series, points can be specified for each state and their properties will be used instead of the auto generated points. For example:

回到第一个例子,我们使用一系列美国,点是在内部生成的。 为了自定义系列的各个地图图层形状,可以为每个状态指定点,并且将使用其属性代替自动生成的点。 例如:


{
type:'map',
series:[{
map:'us',
points:[{
map:'us.il',
color:'red'
}]
}]
}

See the Pen by Arthur Puszynski (@jsblog) on CodePen.

看笔 由Arthur Puszynski( @jsblog )在CodePen上编写 。

地图上下文 (Map Context)

Another useful mapping concept in JSCharting is base layers. These layers are used to show continuation of landmasses when the surrounding areas of the Map are not part of the data series. For example, when showing a map of the US, we can optionally add Mexico and Canada as context layers. These layers do not affect the view bounds of the map and appear grayed out so visual focus remains on the landmass of primary interest.

JSCharting中另一个有用的映射概念是基础层。 当地图的周围区域不是数据系列的一部分时,这些图层用于显示陆块的延续。 例如,当显示美国地图时,我们可以选择将墨西哥和加拿大添加为上下文图层。 这些图层不会影响地图的视图范围,而是显示为灰色,因此视觉焦点仍停留在主要关注的陆地上。


{
mappingBaseLayers:'mx,ca'
}

For more examples of map related features, see the js map features gallery

有关与地图相关的功能的更多示例,请参见js地图功能库

绑定数据 (Binding to data)

Now that we have the basics covered, let's bind maps to real-world data. For this, we will use the following dataset pulled from a live google sheets document so the map data will always reflect the new data and edits made on the sheet in real-time.

现在我们已经涵盖了基础知识,让我们将地图绑定到实际数据。 为此,我们将使用以下数据集,这些数据集是从实时Google表格文档中提取的,因此地图数据将始终实时反映新数据和在表格上进行的实时编辑。

A utility function will convert the spreadsheet JSON data into a series of points. The data feed contains an array of rows with state abbreviations and a value for each state. These rows are mapped to points and passed on to the chart.

实用程序功能会将电子表格JSON数据转换为一系列点。 数据Feed包含一个行数组,每个行带有状态缩写和每个状态的值。 这些行映射到点并传递到图表。

Note: When identifying states, the HASC code syntax such as ‘us.il’ is used to specify Illinois. However, FIPS is also supported (where applicable) and the equivalent code for Illinois would be written as ‘us.fips:US17’. For a complete reference of map codes for all world countries, see this this reference

注意:标识状态时,使用HASC代码语法(例如“ us.il”)指定伊利诺伊州。 但是,也支持FIPS(如果适用),并且伊利诺伊州的等效代码将写为“ us.fips:US17”。 有关世界所有国家/地区的地图代码的完整参考,请参阅此参考

This associates the state codes to point map properties and the value to the Z value property. We don't use Y values here, which are commonly used by most chart types, because Y values represent the Latitude coordinates in maps. Z values can be thought of as magnitude.

这会将状态代码关联到点图属性,并将值关联到Z值属性。 我们这里不使用大多数图表类型常用的Y值,因为Y值表示地图中的纬度坐标。 Z值可以视为幅度。

The data is now loaded for the chart; however, this chart does not yet visualize the Z values on this map. We will use a feature named smartPalettes to bind the point Z values to a color scale in order to visualize the Z values by color coding them.

现在已为图表加载了数据; 但是,此图表尚未在此地图上可视化Z值。 我们将使用名为smartPalettes的功能将点Z值绑定到色标,以便通过对Z值进行颜色编码来可视化它们。


palette:{
pointValue:'{%zValue}',
colors:['green','yellow','red']
}

First we specify the value we will bind to the palette through the pointValue property. This can be bound to any point level token in addition to expressions that evaluate mathematical formulas dynamically. Next, we specify a set of colors that will apply to the range of values available for each point, based on its value.

首先,我们指定要通过pointValue属性绑定到调色板的值。 除了可以动态评估数学公式的表达式外,它还可以绑定到任何点级标记。 接下来,我们基于其值指定一组颜色,这些颜色将应用于每个点的可用值范围。

Now this map visualizes the data bound to the point z values:

现在,此地图显示了绑定到点z值的数据:

See the Pen by Arthur Puszynski (@jsblog) on CodePen.

看笔 由Arthur Puszynski( @jsblog )在CodePen上编写 。

SmartPalettes (SmartPalettes)

Let's delve a little deeper into palettes and explore some of the additional options. When we specify an array of colors, they are rendered in order on the scale with equal allocations; for more control of color placement, we can use the stops property as shown in Palette 1 below. Color stops define the exact positions for each color on a range of 0 to 1 in place of the default.

让我们更深入地研究调色板并探索一些其他选项。 当我们指定一个颜色数组时,它们会按比例分配相等的比例在比例尺上渲染; 为了更好地控制颜色位置,我们可以使用Stops属性,如下面的调色板1所示。 色标在0到1的范围内定义每种颜色的准确位置,以代替默认位置。

See the Pen by Arthur Puszynski (@jsblog) on CodePen.

看笔 由Arthur Puszynski( @jsblog )在CodePen上编写 。

Color stops are defined with a position on the scale between 0-1. This is similar to conventional gradient fill color stops. And conventionally, if we wanted this range to remain green between 0 and .5, then fade to yellow as it approaches 1, an additional color stop would be required. SmartPalettes have a color snapping feature that allows this to be applied more easily and without additional color stops. In the Palette 2 example, we will indicate that the green color should snap to half of the range between it and the next stop.

色标的定义范围是0-1。 这类似于常规的渐变填充色标。 通常,如果我们希望该范围保持在0到.5之间的绿色,然后在接近1时逐渐变为黄色,则需要附加的色标。 SmartPalettes具有颜色捕捉功能,可以更轻松地应用此功能,而无需其他颜色停止。 在调色板2的示例中,我们将指示绿色应捕捉到其与下一档之间范围的一半。

If we wanted the yellow color to remain solid from .5 to 1 instead, the Palette 3 configuration could be used.

如果我们希望黄色在0.5到1之间保持不变,则可以使用调色板3配置。

Here, the setting indicates that green should start transitioning immediately at 0 (default) and end the transition at .5.

在此,该设置指示绿色应立即从0(默认值)开始过渡,并在0.5处结束过渡。

We tie all this together in Palette 4, where we will use a more complex case with two colors, while having them remain mostly solid except for a small portion in the middle where the colors transition seamlessly.

我们在调色板4中将所有这些联系在一起,在这里我们将使用两种颜色的更复杂的盒子,同时使它们大部分保持稳定,除了中间的一小部分颜色可以无缝过渡。

Note: A set of predefined color scales is available in this smart palette gallery sample

注意:此智能调色板库样本中提供了一组预定义的色标

This approach is used very effectively on the US election map example where the colors snap to either red or blue, but in states that were close, intermediary colour variations are still rendered.

在美国选举地图示例中,该方法可以非常有效地使用该示例,在该示例中,颜色会变为红色或蓝色,但是在相近的状态下,仍会呈现中间颜色变化。

结论 (Conclusion)

In this article we have started to scratch the surface of mapping with JSCharting. The map related API is very intuitive and makes it easy to get started quickly. The built-in map data set allows you to immediately create map charts without having to learn or be aware of map data format standards; however, advanced users are also able to load custom geoJSON and topoJSON files as needed. Despite the simplicity of the API, the mapping component is designed with developer convenience at its core.

在本文中,我们开始使用JSCharting从头开始进行映射。 与地图相关的API非常直观,可以轻松快速上手。 内置的地图数据集使您可以立即创建地图,而无需学习或了解地图数据格式标准。 但是,高级用户也可以根据需要加载自定义的geoJSON和topoJSON文件。 尽管API很简单,但映射组件的设计核心是为开发人员提供便利。

翻译自: https://davidwalsh.name/js-charting-mapping

机械制图国家标准的绘图模板


http://www.taodudu.cc/news/show-2234087.html

相关文章:

  • 机械制图标准化基础知识简介
  • 计算机制图的相关标准,机械制图国家标准与计算机绘图.docx
  • 推荐几款实用性强的外业勘察地图软件
  • Cesium地图不加载或者加载有问题怎么办
  • GoogleEarth的安装与使用
  • 启动画面不简单
  • MacOS 10.15 Catalina:13个问题和修复
  • 解决问题之道
  • ios appstore 上架应用被拒绝原因
  • OIer有趣代码+资料整理 1.0.0.8.7
  • cocos2d-js 开发常见问题
  • 空间距离传感技术
  • 01-什么是网络爬虫
  • [人工智能-综述-3]:人工智能与硅基生命,人类终将成为造物主
  • 每周分享第 18 期
  • cesium 页面多 viewer 地图加载过缓解决方案
  • 黑屏后面藏了什么?--解读微软打击盗版
  • (4.6.28)关于Android 64K引发的MultiDex你想知道的都在这里:一场由启动黑屏引发的惨案
  • 使用WebGL和JavaScript构建地球
  • webgl 地球_使用WebGL和JavaScript构建地球
  • Google Earth 嵌入Qt应用程序
  • 谷歌地球 hosts文件_NO—谷歌地球===YESgt;gt;GoogleEarth
  • 【2021-07最新可用】解决谷歌地球、Google地球、Google Earth Pro无法正常启动:启动一直转圈圈、无法链接到登录服务器 、显示黑屏地图无法加载 、软件无法启动双击图标没反应等
  • 【2021亲测有效】彻底解决Google地球、Google Earth、谷歌地球启动无法连接到登录服务器、启动黑屏、无法查看历史影像图的方法
  • ftp 创建工具下载,三款ftp 创建工具下载-免安装版(亲测)
  • FlashFXP v5.3.0.3932中文版
  • FlashFXP 5.0.0官方中文破解版,附文件下载地址和破解码
  • 随身系统veket linux v3.11简体中文免费版,《veket随身系统》下载(veket linux)1.9
  • Serv-U FTP - v15.3.1.155特别版
  • ftp下载工具 免费,7大值得推荐的免费版ftp下载工具

机械制图国家标准的绘图模板_JS制图:映射相关推荐

  1. 机械制图国家标准的绘图模板_如何使用p5js构建绘图应用

    机械制图国家标准的绘图模板 The theme for week #5 of the Weekly Coding Challenge is: 每周编码挑战第5周的主题是: 创建绘图应用程序 (Crea ...

  2. 机械制图及计算机绘图试题库,机械制图及计算机绘图试题库下

    机械制图及计算机绘图试题库下 (36页) 本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦! 4.90 积分 01 填空题填空题 0101A01. 现行的国家标准中 ...

  3. 计算机学机械制图吗,机械制图与计算机绘图(少学时·任务驱动模式)

    机械制图与计算机绘图(少学时·任务驱动模式) 作 者:王怀英 主编 出版时间:2012 内容简介 王怀英主编的<机械制图与计算机绘图>是<全国技工院校"十二五"系 ...

  4. 组合体计算机绘图的实验原理,机械制图及计算机绘图

    <机械制图及计算机绘图>由会员分享,可在线阅读,更多相关<机械制图及计算机绘图(8页珍藏版)>请在人人文库网上搜索. 1.精品 料推荐湖南农业大学实验项目卡片填报单位(公章) ...

  5. 急我所需!机器学习、深度学习绘图模板.ppt

    推荐一个绘图模板,非常适合深度学习的绘图! 大家可以自定义自己需要的图形,上面已经提供了基本的元素,根据自己的需求去调整使用即可! 除了深度学习画图,机器学习的图也有很多,无论你是在校学生还是教师.亦 ...

  6. 我的机器学习和深度学习绘图模板.pptx

    推荐一个绘图模板,非常适合深度学习的绘图,可以看下效果: 大家可以自定义自己需要的图形,上面已经提供了基本的元素,根据自己的需求去调整使用即可! 这个项目地址为:https://github.com/ ...

  7. CREO:CREO软件中如何设置和使用各种标准模板文件(asm组件模板、drw工程图模板、prt零件模板)、零件模板的定制、创建零件自动产生绘图、绘图模板的定制之详细攻略

    CREO:CREO软件中如何设置和使用各种标准模板文件(asm组件模板.drw工程图模板.prt零件模板).零件模板的定制.创建零件自动产生绘图.绘图模板的定制之详细攻略 目录

  8. 机械制图及计算机绘图试题库,101机械制图及计算机绘图1试题库..doc

    101机械制图及计算机绘图1试题库. <机械制图及计算机绘图1>试题 分值分配表 题号一二三四五六题型点线面投影补线图绘制三视图补第三视图组合体尺寸标注轴测图绘制分值30161220121 ...

  9. 推荐!最新机器学习、深度学习绘图模板.ppt

    推荐一个绘图模板,非常适合深度学习的绘图! 大家可以自定义自己需要的图形,上面已经提供了基本的元素,根据自己的需求去调整使用即可! 除了深度学习画图,机器学习的图也有很多,无论你是在校学生还是教师.亦 ...

  10. 101页下载 机器学习、深度学习绘图模板.ppt

    推荐一个绘图模板,非常适合深度学习的绘图! 关注文章公众号 对话框回复 " 绘图模板 " 获取下载 大家可以自定义自己需要的图形,上面已经提供了基本的元素,根据自己的需求去调整使用 ...

最新文章

  1. linux mysql库看不见,linux下Mysql找不到mysqlclient库!谢谢大家
  2. IIS7开启gZip动态压缩
  3. 升级锦囊 | 测试开发核心技术46讲
  4. 第2关:子节点创建、列出、删除
  5. c++ 中文 base64加密_这次有点骚了,破解安卓某 APP 低层加密
  6. 【ESIM】论文阅读笔记:文本蕴含之ESIM
  7. 基础知识的困惑让BUG更隐蔽
  8. eclipse 中的注释 快捷键
  9. (2)[wp7数据存储] WP7 IsolatedStorage系列篇——获取存储的文件或文件夹 [复制链接]...
  10. c语言游戏源码_【C语言/C++】益智游戏开发:2048(思路+源码详解)
  11. 10道Struts2面试题
  12. 今天来聊聊CAD的“外挂”
  13. 晶闸管整流桥matlab仿真,整流12脉中频电源MATLAB-Simulink仿真及谐波分析
  14. Incorrect string value: ‘\xE4\xBB\x8E\xE5\x85\xA5...‘ for column ‘detail‘ at row 1
  15. netty之wakeup详解
  16. 学生结构体,学生有姓名 学号 三门成绩 班级人数为五人 。实现 1:第一门成绩的平均分;2:找出两门以上不及格的学生,输出他们的姓名学号及三门成绩; 3:找出平均分在90分以上或者全部成绩在85分以上
  17. python模拟登录注册知网
  18. svn下载安装与使用教程/方法
  19. 最全的软件测试面试题(含答案)
  20. Android 基础:Materia Design 定义视图阴影elevation和创建卡片CardView

热门文章

  1. Java8 stream toMap 解决 key 冲突
  2. BSOD issue - collect complete memory dump
  3. VScode代码美化工具Beautify
  4. arduino/Mixly使用MAX30102心率传感器
  5. win10家庭版升级为专业版
  6. 思维导图模板怎么下载
  7. 微信h5开发遇到的小问题
  8. meta—learning调研及MAML概述
  9. 服务器安装julia_julia | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror...
  10. Android开发之EditText属性详解