UNPKG

thematic-earth

Version:

HTML-based, whole-Earth thematic maps using locally hosted data layers

2 lines 10.3 kB
/* Copyright (c) 2023 Read Write Tools. Legal use subject to the Thematic Earth Software License Agreement. */ import terminal from'../dev/terminal.js';export const scaleLabels=['map-labels-begin','map-labels-low','map-labels-high','map-labels-end'];export const scaleStrokes=['map-strokes-begin','map-strokes-low','map-strokes-high','map-strokes-end'];export const scaleSymbols=['map-symbols-begin','map-symbols-low','map-symbols-high','map-symbols-end'];export const sbProperties=['stroke-brush','sb-symbol-type','sb-symbol-spacing','sb-symbol-repeat','sb-symbol-stroke-width','sb-symbol-fill-color','sb-symbol-stroke-color','sb-symbol-background-color','sb-symbol-size','sb-symbol-inner-size','sb-symbol-node-count','sb-symbol-code-point','sb-symbol-thickness','sb-symbol-stroke-alignment','sb-hatch-stroke-type','sb-hatch-stroke-spacing','sb-hatch-stroke-direction','sb-hatch-stroke-width','sb-hatch-stroke-color','sb-hatch-background-color','sb-hatch-thickness','sb-hatch-stroke-alignment','sb-crosshatch-stroke-type','sb-crosshatch-stroke-spacing','sb-crosshatch-stroke-direction','sb-crosshatch-stroke-width','sb-crosshatch-stroke-color','sb-crosshatch-background-color','sb-crosshatch-thickness','sb-crosshatch-stroke-alignment'];export const fpProperties=['fill-pattern','fp-symbol-type','fp-symbol-spacing','fp-symbol-repeat','fp-symbol-stroke-width','fp-symbol-fill-color','fp-symbol-stroke-color','fp-symbol-background-color','fp-symbol-size','fp-symbol-inner-size','fp-symbol-node-count','fp-symbol-code-point','fp-hatch-stroke-type','fp-hatch-stroke-spacing','fp-hatch-stroke-direction','fp-hatch-stroke-width','fp-hatch-stroke-color','fp-hatch-background-color','fp-crosshatch-stroke-type','fp-crosshatch-stroke-spacing','fp-crosshatch-stroke-direction','fp-crosshatch-stroke-width','fp-crosshatch-stroke-color','fp-crosshatch-background-color'];export const pointProperties=['symbol-type','symbol-stroke-width','symbol-stroke-color','symbol-fill-color','symbol-size','symbol-inner-size','symbol-node-count','symbol-code-point'];export const lineProperties=['stroke-width','stroke-color','stroke-type','over-stroke-width','over-stroke-color','over-stroke-type'];export const polygonProperties=['fill-color','fill-composition','fill-gradient','fg-saturation','fg-brightness','fg-transparency'];export const sphereProperties=['stroke-width','stroke-color','fill-color','fill-composition'];export const spaceProperties=['deep-space','deep-space-color','deep-space-star-count','deep-space-star-color','earth-glow','earth-glow-size','earth-glow-offset','earth-glow-axis','earth-glow-inner-color','earth-glow-outer-color','sunrise','sunrise-inner-radius','sunrise-outer-radius','sunrise-inner-color','sunrise-outer-color'];export const labelProperties=['label-feature-key','label-stroke-color','label-stroke-width','label-fill-color','label-font-family','label-font-size','label-font-weight','label-font-style','label-font-variant','label-font-stretch','label-letter-spacing','label-word-spacing','label-shadow-color','label-shadow-blur','label-shadow-offset-x','label-shadow-offset-y'];export const labelPointProperties=['label-offset','label-position','label-debug-alt-positions'];export const labelLineProperties=['label-orientation','label-debug-alt-curves'];export const labelPolygonProperties=['label-debug-alt-slots'];export const readOnlyProperties=['scale-symbols-coefficient','scale-strokes-coefficient','scale-labels-coefficient','display-symbols-threshold','display-strokes-threshold','display-labels-threshold','unknown'];export const validPointProperties=pointProperties.concat(['visibility','map-basis'],scaleSymbols,scaleStrokes,scaleLabels,labelProperties,labelPointProperties);export const validLineProperties=lineProperties.concat(['visibility','transparency','map-basis'],scaleSymbols,scaleStrokes,scaleLabels,sbProperties,labelProperties,labelLineProperties);export const validPolygonProperties=polygonProperties.concat(['visibility','transparency','map-basis'],scaleSymbols,scaleStrokes,scaleLabels,sbProperties,fpProperties,lineProperties,labelProperties,labelPolygonProperties);export const validSphereProperties=sphereProperties.concat(['visibility','transparency','map-basis'],scaleSymbols,scaleStrokes,scaleLabels);export const validSpaceProperties=spaceProperties.concat(['visibility','map-basis'],scaleSymbols,scaleStrokes,scaleLabels);export const validLabelProperties=labelProperties.concat(['visibility','transparency','map-basis'],scaleSymbols,scaleStrokes,scaleLabels);export const allLabelProperties=[].concat(scaleSymbols,scaleStrokes,scaleLabels,labelProperties,labelPointProperties,labelLineProperties,labelPolygonProperties);export const allProperties=[].concat(['visibility','transparency','map-basis'],scaleSymbols,scaleStrokes,scaleLabels,sbProperties,fpProperties,pointProperties,lineProperties,polygonProperties,sphereProperties,spaceProperties,labelProperties,labelPointProperties,labelLineProperties,labelPolygonProperties);export function getGroupName(s){var e=displayOrder[s];null==e&&(e=displayOrder.unknown);var o=e.substr(0,2),r=groupNames[o];return null==r?(terminal.logic(`${o} not defined in TessGrammar.groupNames`),'unknown'):r}export function getAssignedRGB(s){var e=displayOrder[s];null==e&&(e=displayOrder.unknown);var o=e.substr(0,4),r=assignedColorValues[o];return null==r?(terminal.logic(`${o} not defined in TessGrammar.assignedColorValues`),'#777'):r}export const groupNames={'01':'symbol','02':'stroke','03':'brush','04':'fill','05':'pattern','06':'sphere','07':'space','08':'label','09':'scale',10:'feature',11:'readonly'};export const assignedColorValues={'01-1':'#ff0000ff','02-1':'#ff7f0aff','03-1':'#ff9f00ff','03-2':'#ffbf00ff','03-3':'#ffd700ff','03-4':'#ffff00ff','04-1':'#7fff00ff','04-2':'#66cc00ff','05-1':'#00afffff','05-2':'#008fffff','05-3':'#006fffff','05-4':'#005fffff','07-1':'#4f4fffff','07-2':'#2f2fffff','07-3':'#0f0fffff','08-1':'#7f00ffff','08-2':'#8c19ffff','08-3':'#9933ffff','08-4':'#a54dffff','08-5':'#9545e6ff','08-6':'#843dccff','08-7':'#7436b3ff','09-1':'#a70033ff','09-2':'#c70077ff','09-3':'#d700bbff','09-4':'#e700ffff','10-1':'#f744beff','11-1':'#606060ff','11-2':'#707070ff','11-3':'#808080ff'};export const displayOrder={'symbol-type':'01-100','symbol-stroke-width':'01-101','symbol-stroke-color':'01-102','symbol-fill-color':'01-103','symbol-size':'01-104','symbol-inner-size':'01-105','symbol-node-count':'01-106','symbol-code-point':'01-107','stroke-width':'02-100','stroke-color':'02-101','stroke-type':'02-102','over-stroke-width':'02-103','over-stroke-color':'02-104','over-stroke-type':'02-105','stroke-brush':'03-100','sb-symbol-type':'03-201','sb-symbol-spacing':'03-202','sb-symbol-repeat':'03-203','sb-symbol-stroke-width':'03-204','sb-symbol-fill-color':'03-205','sb-symbol-stroke-color':'03-206','sb-symbol-background-color':'03-207','sb-symbol-size':'03-208','sb-symbol-inner-size':'03-209','sb-symbol-node-count':'03-210','sb-symbol-code-point':'03-211','sb-symbol-thickness':'03-212','sb-symbol-stroke-alignment':'03-213','sb-hatch-stroke-type':'03-314','sb-hatch-stroke-spacing':'03-315','sb-hatch-stroke-direction':'03-316','sb-hatch-stroke-width':'03-317','sb-hatch-stroke-color':'03-318','sb-hatch-background-color':'03-319','sb-hatch-thickness':'03-320','sb-hatch-stroke-alignment':'03-321','sb-crosshatch-stroke-type':'03-422','sb-crosshatch-stroke-spacing':'03-423','sb-crosshatch-stroke-direction':'03-424','sb-crosshatch-stroke-width':'03-425','sb-crosshatch-stroke-color':'03-426','sb-crosshatch-background-color':'03-427','sb-crosshatch-thickness':'03-428','sb-crosshatch-stroke-alignment':'03-429','fill-color':'04-100','fill-composition':'04-101','fill-gradient':'04-202','fg-saturation':'04-203','fg-brightness':'04-204','fg-transparency':'04-205','fill-pattern':'05-100','fp-symbol-type':'05-201','fp-symbol-spacing':'05-202','fp-symbol-repeat':'05-203','fp-symbol-stroke-width':'05-204','fp-symbol-fill-color':'05-205','fp-symbol-stroke-color':'05-206','fp-symbol-background-color':'05-207','fp-symbol-size':'05-208','fp-symbol-inner-size':'05-209','fp-symbol-node-count':'05-210','fp-symbol-code-point':'05-211','fp-hatch-stroke-type':'05-314','fp-hatch-stroke-spacing':'05-315','fp-hatch-stroke-direction':'05-316','fp-hatch-stroke-width':'05-317','fp-hatch-stroke-color':'05-318','fp-hatch-background-color':'05-319','fp-crosshatch-stroke-type':'05-422','fp-crosshatch-stroke-spacing':'05-423','fp-crosshatch-stroke-direction':'05-424','fp-crosshatch-stroke-width':'05-425','fp-crosshatch-stroke-color':'05-426','fp-crosshatch-background-color':'05-427','deep-space':'07-100','deep-space-color':'07-101','deep-space-star-count':'07-102','deep-space-star-color':'07-103','earth-glow':'07-204','earth-glow-size':'07-205','earth-glow-offset':'07-206','earth-glow-axis':'07-207','earth-glow-inner-color':'07-208','earth-glow-outer-color':'07-209',sunrise:'07-310','sunrise-inner-radius':'07-311','sunrise-outer-radius':'07-312','sunrise-inner-color':'07-313','sunrise-outer-color':'07-314','label-feature-key':'08-100','label-stroke-color':'08-201','label-stroke-width':'08-202','label-fill-color':'08-203','label-font-family':'08-304','label-font-size':'08-305','label-font-weight':'08-306','label-font-style':'08-307','label-font-variant':'08-308','label-font-stretch':'08-309','label-letter-spacing':'08-410','label-word-spacing':'08-411','label-shadow-color':'08-512','label-shadow-blur':'08-513','label-shadow-offset-x':'08-514','label-shadow-offset-y':'08-515','label-position':'08-616','label-offset':'08-617','label-orientation':'08-618','label-debug-alt-positions':'08-719','label-debug-alt-curves':'08-720','label-debug-alt-slots':'08-721','map-basis':'09-100','map-symbols-begin':'09-201','map-symbols-low':'09-202','map-symbols-high':'09-203','map-symbols-end':'09-204','map-strokes-begin':'09-305','map-strokes-low':'09-306','map-strokes-high':'09-307','map-strokes-end':'09-308','map-labels-begin':'09-409','map-labels-low':'09-410','map-labels-high':'09-411','map-labels-end':'09-412',visibility:'10-100',transparency:'10-101','scale-symbols-coefficient':'11-100','scale-strokes-coefficient':'11-101','scale-labels-coefficient':'11-102','display-symbols-threshold':'11-203','display-strokes-threshold':'11-204','display-labels-threshold':'11-205',unknown:'11-306'};