Home Information - Your home, your data, organized.
Python
Added Location View SVG styling with choice of color or greyscale.
Anthony Cassandra3ef2f206d114
diff --git a/src/hi/apps/location/admin.py b/src/hi/apps/location/admin.pyindex af6c0b9c..752a56f2 100644--- a/src/hi/apps/location/admin.py+++ b/src/hi/apps/location/admin.py@@ -38,6 +38,7 @@ class LocationViewAdmin(admin.ModelAdmin):'svg_view_box_str','svg_rotate','order_id',+ 'svg_style_name_str','created_datetime','updated_datetime',)diff --git a/src/hi/apps/location/edit/forms.py b/src/hi/apps/location/edit/forms.pyindex 54ae850d..c1496b28 100644--- a/src/hi/apps/location/edit/forms.py+++ b/src/hi/apps/location/edit/forms.py@@ -7,7 +7,7 @@ from django.conf import settingsfrom hi.apps.attribute.forms import AttributeForm, AttributeUploadFormfrom hi.apps.common.svg_forms import SvgDecimalFormField, SvgFileForm-from hi.apps.location.enums import LocationViewType+from hi.apps.location.enums import LocationViewType, SvgStyleNamefrom hi.apps.location.models import (Location,LocationAttribute,@@ -105,6 +105,7 @@ class LocationViewEditForm( forms.ModelForm ):'svg_view_box_str','svg_rotate','location_view_type_str',+ 'svg_style_name_str',)svg_rotate = SvgDecimalFormField()@@ -116,6 +117,13 @@ class LocationViewEditForm( forms.ModelForm ):required = True,widget = forms.Select( attrs = { 'class' : 'custom-select' } ),)+ svg_style_name_str = forms.ChoiceField(+ label = 'SVG Style Name',+ choices = SvgStyleName.choices,+ initial = SvgStyleName.default_value(),+ required = True,+ widget = forms.Select( attrs = { 'class' : 'custom-select' } ),+ )class LocationViewGeometryForm( forms.ModelForm ):diff --git a/src/hi/apps/location/enums.py b/src/hi/apps/location/enums.pyindex 4a89bc54..581939a4 100644--- a/src/hi/apps/location/enums.py+++ b/src/hi/apps/location/enums.py@@ -82,8 +82,8 @@ class LocationViewType(LabeledEnum):class SvgItemType(LabeledEnum):- ICON = ( 'Icon', '' )- OPEN_PATH = ( 'Open Path ', '' )+ ICON = ( 'Icon', '' )+ OPEN_PATH = ( 'Open Path ', '' )CLOSED_PATH = ( 'Closed Path ', '' )@property@@ -97,3 +97,17 @@ class SvgItemType(LabeledEnum):@propertydef is_path_closed(self):return bool( self == SvgItemType.CLOSED_PATH )+++class SvgStyleName(LabeledEnum):++ GREYSCALE = ( 'Grey Scale ', '' )+ COLOR = ( 'Color', '' )++ @property+ def svg_defs_template_name(self):+ return f'location/panes/svg_fill_patterns_{self}.html'++ @property+ def css_static_file_name(self):+ return f'css/svg-location-{self}.css'diff --git a/src/hi/apps/location/migrations/0002_locationview_svg_style_name_str.py b/src/hi/apps/location/migrations/0002_locationview_svg_style_name_str.pynew file mode 100644index 00000000..70e60992--- /dev/null+++ b/src/hi/apps/location/migrations/0002_locationview_svg_style_name_str.py@@ -0,0 +1,21 @@+# Generated by Django 4.2.15 on 2025-01-18 22:32++from django.db import migrations, models+++class Migration(migrations.Migration):++ dependencies = [+ ("location", "0001_initial"),+ ]++ operations = [+ migrations.AddField(+ model_name="locationview",+ name="svg_style_name_str",+ field=models.CharField(+ default="greyscale", max_length=32, verbose_name="Style Name"+ ),+ preserve_default=False,+ ),+ ]diff --git a/src/hi/apps/location/models.py b/src/hi/apps/location/models.pyindex 4a73c174..7f607177 100644--- a/src/hi/apps/location/models.py+++ b/src/hi/apps/location/models.py@@ -8,7 +8,7 @@ from hi.apps.attribute.models import AttributeModelfrom hi.enums import ItemTypefrom hi.models import ItemTypeModelMixin-from .enums import LocationViewType+from .enums import LocationViewType, SvgStyleNamelogger = logging.getLogger(__name__)@@ -141,6 +141,11 @@ class LocationView( models.Model, ItemTypeModelMixin ):svg_rotate = SvgDecimalField('Rotate',)+ svg_style_name_str = models.CharField(+ 'Style Name',+ max_length = 32,+ null = False, blank = False,+ )order_id = models.PositiveIntegerField('Order Id',default = 0,@@ -188,6 +193,15 @@ class LocationView( models.Model, ItemTypeModelMixin ):def svg_view_box( self, svg_view_box : SvgViewBox ):self.svg_view_box_str = str(svg_view_box)return++ @property+ def svg_style_name(self):+ return SvgStyleName.from_name_safe( self.svg_style_name_str )++ @svg_style_name.setter+ def svg_style_name( self, svg_style_name : SvgStyleName ):+ self.svg_style_name_str = str(svg_style_name)+ returnclass LocationItemModelMixin( ItemTypeModelMixin ):diff --git a/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.html b/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.htmlindex d3434f72..2786c037 100644--- a/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.html+++ b/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.html@@ -40,3 +40,8 @@</div>{{ location_view_edit_form.location_view_type_str.errors }}</div>+<div>+ {{ location_view_edit_form.svg_style_name_str.label }}+ {{ location_view_edit_form.svg_style_name_str }}+ {{ location_view_edit_form.svg_style_name_str.errors }}+</div>diff --git a/src/hi/apps/location/templates/location/panes/location_view.html b/src/hi/apps/location/templates/location/panes/location_view.htmlindex 97255aba..93490ca4 100644--- a/src/hi/apps/location/templates/location/panes/location_view.html+++ b/src/hi/apps/location/templates/location/panes/location_view.html@@ -1,24 +1,29 @@+{% load static %}{% load common_template_helpers %}+<link rel="stylesheet" href="{% static location_view.svg_style_name.css_static_file_name %}"><div id="hi-location-view-main" class="hi-location-view">- <svg id="{{ location_view_data.location_view.html_id }}"+ <svg id="{{ location_view.html_id }}"class="hi-location-view"- location-view-id="{{ location_view_data.location_view.id }}"+ location-view-id="{{ location_view.id }}"xmlns="http://www.w3.org/2000/svg"- viewBox="{{ location_view_data.location_view.svg_view_box }}"- extents="{{ location_view_data.location_view.location.svg_view_box }}"+ viewBox="{{ location_view.svg_view_box }}"+ extents="{{ location_view.location.svg_view_box }}"width="100%" height="100%" preserveAspectRatio="xMidYMid meet"- transform="rotate({{ location_view_data.location_view.svg_rotate }} 0 0)">+ transform="rotate({{ location_view.svg_rotate }} 0 0)">+ <defs>+ {% include location_view.svg_style_name.svg_defs_template_name %}+ </defs><g class="hi-location-view-base">- {% include_media_template location_view_data.location_view.location.svg_fragment_filename %}+ {% include_media_template location_view.location.svg_fragment_filename %}+ </g>+ <g class="hi-location-view-entities">+ {% for svg_path_item in location_view_data.svg_path_items %}+ {% include "location/panes/svg_path_item.html" with svg_path_item=svg_path_item %}+ {% endfor %}++ {% for svg_icon_item in location_view_data.svg_icon_items %}+ {% include "location/panes/svg_icon_item.html" with svg_icon_item=svg_icon_item %}+ {% endfor %}</g>-- {% for svg_path_item in location_view_data.svg_path_items %}- {% include "location/panes/svg_path_item.html" with svg_path_item=svg_path_item %}- {% endfor %}-- {% for svg_icon_item in location_view_data.svg_icon_items %}- {% include "location/panes/svg_icon_item.html" with svg_icon_item=svg_icon_item %}- {% endfor %}-</svg></div>diff --git a/src/hi/apps/location/templates/location/panes/svg_fill_patterns_color.html b/src/hi/apps/location/templates/location/panes/svg_fill_patterns_color.htmlnew file mode 100644index 00000000..9117165c--- /dev/null+++ b/src/hi/apps/location/templates/location/panes/svg_fill_patterns_color.html@@ -0,0 +1,79 @@+<pattern id="ground-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#e8dcc3" />+ <circle cx="5" cy="5" r="2" fill="#c8a985" />+ <circle cx="15" cy="7" r="1.5" fill="#d7b89b" />+ <circle cx="10" cy="15" r="1.8" fill="#e5c8a9" />+ <circle cx="18" cy="13" r="1" fill="#f0dcb8" />+ <circle cx="7" cy="12" r="1.2" fill="#c8a985" />+</pattern>+<pattern id="grass-pattern" width="10" height="10" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#f0fff0" />+ <circle cx="5" cy="5" r="2" fill="#d0ffd0" />+</pattern>+<pattern id="pavement-pattern" width="8" height="8" patternUnits="userSpaceOnUse">+ <rect x="0" y="0" width="8" height="8" fill="#e8e8e8" />+ <line x1="0" y1="0" x2="8" y2="8" stroke="#808080" stroke-width="0.5" />+</pattern>+<pattern id="wood-pattern" width="10" height="40" patternUnits="userSpaceOnUse">+ <rect width="10" height="40" fill="#f2e7d9" />+ <line x1="0" y1="5" x2="10" y2="5" stroke="#8b4513" stroke-width="0.5" />+ <line x1="0" y1="15" x2="10" y2="15" stroke="#8b4513" stroke-width="0.5" />+ <line x1="0" y1="25" x2="10" y2="25" stroke="#8b4513" stroke-width="0.5" />+ <line x1="0" y1="35" x2="10" y2="35" stroke="#8b4513" stroke-width="0.5" />+</pattern>+<pattern id="stone-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#b0c4de" />+ <circle cx="5" cy="5" r="4" fill="#778899" />+ <circle cx="15" cy="15" r="4" fill="#708090" />+ <circle cx="15" cy="5" r="4" fill="#778899" />+ <circle cx="5" cy="15" r="4" fill="#708090" />+</pattern>+<pattern id="pavers-pattern" width="10" height="10" patternUnits="userSpaceOnUse">+ <rect width="10" height="10" fill="#d3d3d3" />+ <path d="M 0 0 L 10 0 L 10 10 L 0 10 Z M 5 0 L 5 10 M 0 5 L 10 5"+ stroke="#a9a9a9" stroke-width="0.5" fill="none" />+</pattern>+<pattern id="rock-pattern" width="15" height="15" patternUnits="userSpaceOnUse">+ <rect width="15" height="15" fill="#f0e4d2" />+ <circle cx="4" cy="4" r="2" fill="#c9a98f" />+ <circle cx="11" cy="7" r="3" fill="#d6b8a5" />+ <circle cx="6" cy="12" r="2.5" fill="#e4c9b6" />+</pattern>+<pattern id="foliage-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#e0ffe0" />+ <circle cx="6" cy="6" r="3" fill="#b2d8b2" />+ <circle cx="14" cy="14" r="4" fill="#a3cfa3" />+ <circle cx="6" cy="14" r="2.5" fill="#91bf91" />+ <circle cx="14" cy="6" r="3.5" fill="#b2d8b2" />+</pattern>+<pattern id="water-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#eefffe" />+ <path d="M 0 5 Q 5 0, 10 5 T 20 5" stroke="#1E90FF" stroke-width="1" fill="none" />+ <path d="M 0 15 Q 5 10, 10 15 T 20 15" stroke="#87CEEB" stroke-width="1" fill="none" />+</pattern>+<pattern id="brick-pattern" width="20" height="10" patternUnits="userSpaceOnUse">+ <rect width="20" height="10" fill="#B22222" />+ <path d="M 0 5 H 20 M 10 0 V 10" stroke="#8B0000" stroke-width="1" />+</pattern>+<pattern id="tiles-pattern" width="15" height="15" patternUnits="userSpaceOnUse">+ <rect x="0" y="0" width="100%" height="100%" fill="#f5f5f5" />+ <path d="M 0 0 H 15 V 15 H 0 Z" stroke="#c0c0c0" stroke-width="0.5" fill="none" />+ <line x1="0" y1="15" x2="15" y2="0" stroke="#a0a0a0" stroke-width="0.5" />+</pattern>+<pattern id="mulch-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#d2a679" />+ <path d="M 3 3 L 10 10 M 5 15 L 15 5 M 0 10 L 10 0" stroke="#c19a6b" stroke-width="1.5" />+</pattern>+<pattern id="gravel-pattern" width="15" height="15" patternUnits="userSpaceOnUse">+ <rect width="15" height="15" fill="#D3D3D3" />+ <circle cx="5" cy="5" r="2" fill="#A9A9A9" />+ <circle cx="12" cy="8" r="1.5" fill="#808080" />+ <circle cx="8" cy="12" r="2.5" fill="#696969" />+</pattern>+<pattern id="asphalt-pattern" width="10" height="10" patternUnits="userSpaceOnUse">+ <rect width="10" height="10" fill="#2F4F4F" />+ <circle cx="3" cy="3" r="0.5" fill="#696969" />+ <circle cx="7" cy="7" r="0.5" fill="#808080" />+ <circle cx="3" cy="7" r="0.5" fill="#696969" />+ <circle cx="7" cy="3" r="0.5" fill="#808080" />+</pattern>diff --git a/src/hi/apps/location/templates/location/panes/svg_fill_patterns_greyscale.html b/src/hi/apps/location/templates/location/panes/svg_fill_patterns_greyscale.htmlnew file mode 100644index 00000000..8b63b56f--- /dev/null+++ b/src/hi/apps/location/templates/location/panes/svg_fill_patterns_greyscale.html@@ -0,0 +1,86 @@+<pattern id="ground-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#eeeeee" />+ <circle cx="5" cy="5" r="2" fill="#cccccc" />+ <circle cx="15" cy="7" r="1.5" fill="#dddddd" />+ <circle cx="10" cy="15" r="1.8" fill="#e0e0e0" />+ <circle cx="18" cy="13" r="1" fill="#f0f0f0" />+ <circle cx="7" cy="12" r="1.2" fill="#cccccc" />+</pattern>+<pattern id="grass-pattern" width="10" height="10" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#f8f8f8" />+ <circle cx="5" cy="5" r="2" fill="#e0e0e0" />+</pattern>+<pattern id="pavement-pattern" width="8" height="8" patternUnits="userSpaceOnUse">+ <rect x="0" y="0" width="8" height="8" fill="#f0f0f0" />+ <line x1="0" y1="0" x2="8" y2="8" stroke="#b0b0b0" stroke-width="0.5" />+</pattern>+<pattern id="wood-pattern" width="10" height="40" patternUnits="userSpaceOnUse">+ <rect width="10" height="40" fill="#f5f5f5" />+ <line x1="0" y1="5" x2="10" y2="5" stroke="#a0a0a0" stroke-width="0.5" />+ <line x1="0" y1="15" x2="10" y2="15" stroke="#a0a0a0" stroke-width="0.5" />+ <line x1="0" y1="25" x2="10" y2="25" stroke="#a0a0a0" stroke-width="0.5" />+ <line x1="0" y1="35" x2="10" y2="35" stroke="#a0a0a0" stroke-width="0.5" />+</pattern>+<pattern id="wood-pattern" width="10" height="40" patternUnits="userSpaceOnUse">+ <rect width="10" height="40" fill="#f5f5f5" />+ <line x1="0" y1="5" x2="10" y2="5" stroke="#a0a0a0" stroke-width="0.5" />+ <line x1="0" y1="15" x2="10" y2="15" stroke="#a0a0a0" stroke-width="0.5" />+ <line x1="0" y1="25" x2="10" y2="25" stroke="#a0a0a0" stroke-width="0.5" />+ <line x1="0" y1="35" x2="10" y2="35" stroke="#a0a0a0" stroke-width="0.5" />+</pattern>+<pattern id="stone-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#e0e0e0" />+ <circle cx="5" cy="5" r="4" fill="#b0b0b0" />+ <circle cx="15" cy="15" r="4" fill="#a0a0a0" />+ <circle cx="15" cy="5" r="4" fill="#b0b0b0" />+ <circle cx="5" cy="15" r="4" fill="#a0a0a0" />+</pattern>+<pattern id="pavers-pattern" width="10" height="10" patternUnits="userSpaceOnUse">+ <rect width="10" height="10" fill="#e0e0e0" />+ <path d="M 0 0 L 10 0 L 10 10 L 0 10 Z M 5 0 L 5 10 M 0 5 L 10 5"+ stroke="#b0b0b0" stroke-width="0.5" fill="none" />+</pattern>+<pattern id="rock-pattern" width="15" height="15" patternUnits="userSpaceOnUse">+ <rect width="15" height="15" fill="#f0f0f0" />+ <circle cx="4" cy="4" r="2" fill="#d0d0d0" />+ <circle cx="11" cy="7" r="3" fill="#c0c0c0" />+ <circle cx="6" cy="12" r="2.5" fill="#e0e0e0" />+</pattern>+<pattern id="foliage-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#f8f8f8" />+ <circle cx="6" cy="6" r="3" fill="#d0d0d0" />+ <circle cx="14" cy="14" r="4" fill="#c0c0c0" />+ <circle cx="6" cy="14" r="2.5" fill="#b0b0b0" />+ <circle cx="14" cy="6" r="3.5" fill="#d0d0d0" />+</pattern>+<pattern id="water-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#f0f0f0" />+ <path d="M 0 5 Q 5 0, 10 5 T 20 5" stroke="#b0b0b0" stroke-width="1" fill="none" />+ <path d="M 0 15 Q 5 10, 10 15 T 20 15" stroke="#d0d0d0" stroke-width="1" fill="none" />+</pattern>+<pattern id="brick-pattern" width="20" height="10" patternUnits="userSpaceOnUse">+ <rect width="20" height="10" fill="#e0e0e0" />+ <path d="M 0 5 H 20 M 10 0 V 10" stroke="#a0a0a0" stroke-width="1" />+</pattern>+<pattern id="tiles-pattern" width="15" height="15" patternUnits="userSpaceOnUse">+ <rect x="0" y="0" width="100%" height="100%" fill="#f8f8f8" />+ <path d="M 0 0 H 15 V 15 H 0 Z" stroke="#c0c0c0" stroke-width="0.5" fill="none" />+ <line x1="0" y1="15" x2="15" y2="0" stroke="#a0a0a0" stroke-width="0.5" />+</pattern>+<pattern id="mulch-pattern" width="20" height="20" patternUnits="userSpaceOnUse">+ <rect width="20" height="20" fill="#e0e0e0" />+ <path d="M 3 3 L 10 10 M 5 15 L 15 5 M 0 10 L 10 0" stroke="#b0b0b0" stroke-width="1.5" />+</pattern>+<pattern id="gravel-pattern" width="15" height="15" patternUnits="userSpaceOnUse">+ <rect width="15" height="15" fill="#f0f0f0" />+ <circle cx="5" cy="5" r="2" fill="#c0c0c0" />+ <circle cx="12" cy="8" r="1.5" fill="#a0a0a0" />+ <circle cx="8" cy="12" r="2.5" fill="#909090" />+</pattern>+<pattern id="asphalt-pattern" width="10" height="10" patternUnits="userSpaceOnUse">+ <rect width="10" height="10" fill="#808080" />+ <circle cx="3" cy="3" r="0.5" fill="#a0a0a0" />+ <circle cx="7" cy="7" r="0.5" fill="#b0b0b0" />+ <circle cx="3" cy="7" r="0.5" fill="#a0a0a0" />+ <circle cx="7" cy="3" r="0.5" fill="#b0b0b0" />+</pattern>diff --git a/src/hi/simulator/services/zoneminder/simulator.py b/src/hi/simulator/services/zoneminder/simulator.pyindex 583c6f16..83af5baf 100644--- a/src/hi/simulator/services/zoneminder/simulator.py+++ b/src/hi/simulator/services/zoneminder/simulator.py@@ -97,7 +97,7 @@ class ZoneMinderSimulator( Simulator ):value_str = zm_run_state_type.value,)continue- raise KeyError( f'ZM server entity does not exist.' )+ raise KeyError( 'ZM server entity does not exist.' )@propertydef sim_entity_definition_list(self) -> List[ SimEntityDefinition ]:diff --git a/src/hi/static/css/svg-location-color.css b/src/hi/static/css/svg-location-color.cssnew file mode 100644index 00000000..1dfcc93d--- /dev/null+++ b/src/hi/static/css/svg-location-color.css@@ -0,0 +1,183 @@+svg.hi-location-view path.ground {+ fill: url(#ground-pattern);+ stroke: black;+ stroke-width: 0;+}+svg.hi-location-view path.grass {+ fill: url(#grass-pattern);+ stroke: black;+ stroke-width: 0;+}+svg.hi-location-view path.rock-beds {+ fill: url(#rock-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.stone-walls {+ fill: url(#stone-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.landscape-transitions {+ fill: none;+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.brick {+ fill: url(#brick-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.mulch {+ fill: url(#mulch-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.gravel {+ fill: url(#gravel-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.asphalt {+ fill: url(#asphalt-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.tiles {+ fill: url(#tiles-pattern);+ stroke: #606060;+ stroke-width: 1;+}+svg.hi-location-view path.wood-decks {+ fill: url(#wood-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.pavement {+ fill: url(#pavement-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.pavers {+ fill: url(#pavers-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.pool-coping {+ fill: #a0a0a0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.property-lines {+ fill: none;+ stroke: black;+ stroke-width: 5;+ stroke-dasharray: 50,10,50,10,10,10;+}+svg.hi-location-view path.fencing {+ fill: none;+ stroke: #432b0f;+ stroke-width: 8;+}+svg.hi-location-view path.water {+ fill: url(#water-pattern);+ stroke: none;+ stroke-width: 1;+}+svg.hi-location-view path.sheds {+ fill: #f2d0a7;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.foliage {+ fill: url(#foliage-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.utilities {+ fill: none;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.interior-floors {+ fill: #f8f8f8;+ stroke: none;+ stroke-width: 1;+}+svg.hi-location-view path.floor-transitions {+ fill: none;+ stroke: #404040;+ stroke-width: 1;+ stroke-dasharray: 10, 10;+}+svg.hi-location-view path.stairs {+ fill: none;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.ceiling-transitions {+ fill: none;+ stroke: #404040;+ stroke-width: 1;+ stroke-dasharray: 5, 5;+}+svg.hi-location-view path.interior-walls {+ fill: black;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.windows {+ fill: #78e3df;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.exterior-walls {+ fill: black;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.door-arcs {+ fill: none;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.doors {+ fill: none;+ stroke: black;+ stroke-width: 3;+}+svg.hi-location-view path.countertops {+ fill: #e0e0e0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.fireplaces {+ fill: #fff0f0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.furniture {+ fill: #f2d0a7;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.toilets {+ fill: #e0e0e0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.shelves {+ fill: #fffff0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.bathtubs {+ fill: #f8f8f8;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.sinks {+ fill: #f8f8f8;+ stroke: black;+ stroke-width: 1;+}diff --git a/src/hi/static/css/svg-location-greyscale.css b/src/hi/static/css/svg-location-greyscale.cssnew file mode 100644index 00000000..87c81bd1--- /dev/null+++ b/src/hi/static/css/svg-location-greyscale.css@@ -0,0 +1,183 @@+svg.hi-location-view path.ground {+ fill: url(#ground-pattern);+ stroke: black;+ stroke-width: 0;+}+svg.hi-location-view path.grass {+ fill: url(#grass-pattern);+ stroke: black;+ stroke-width: 0;+}+svg.hi-location-view path.rock-beds {+ fill: url(#rock-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.stone-walls {+ fill: url(#stone-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.landscape-transitions {+ fill: none;+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.brick {+ fill: url(#brick-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.mulch {+ fill: url(#mulch-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.gravel {+ fill: url(#gravel-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.asphalt {+ fill: url(#asphalt-pattern);+ stroke: #606060;+ stroke-width: 4;+}+svg.hi-location-view path.tiles {+ fill: url(#tiles-pattern);+ stroke: #606060;+ stroke-width: 1;+}+svg.hi-location-view path.wood-decks {+ fill: url(#wood-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.pavement {+ fill: url(#pavement-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.pavers {+ fill: url(#pavers-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.pool-coping {+ fill: #a0a0a0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.property-lines {+ fill: none;+ stroke: black;+ stroke-width: 5;+ stroke-dasharray: 50,10,50,10,10,10;+}+svg.hi-location-view path.fencing {+ fill: none;+ stroke: #404040;+ stroke-width: 8;+}+svg.hi-location-view path.water {+ fill: url(#water-pattern);+ stroke: none;+ stroke-width: 1;+}+svg.hi-location-view path.sheds {+ fill: #b0b0b0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.foliage {+ fill: url(#foliage-pattern);+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.utilities {+ fill: none;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.interior-floors {+ fill: #f8f8f8;+ stroke: none;+ stroke-width: 1;+}+svg.hi-location-view path.floor-transitions {+ fill: none;+ stroke: #404040;+ stroke-width: 1;+ stroke-dasharray: 10, 10;+}+svg.hi-location-view path.stairs {+ fill: none;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.ceiling-transitions {+ fill: none;+ stroke: #404040;+ stroke-width: 1;+ stroke-dasharray: 5, 5;+}+svg.hi-location-view path.interior-walls {+ fill: black;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.windows {+ fill: #e0e0e0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.exterior-walls {+ fill: black;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.door-arcs {+ fill: none;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.doors {+ fill: none;+ stroke: black;+ stroke-width: 3;+}+svg.hi-location-view path.countertops {+ fill: #e0e0e0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.fireplaces {+ fill: #fff0f0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.furniture {+ fill: #e0e0e0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.toilets {+ fill: #e0e0e0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.shelves {+ fill: #fffff0;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.bathtubs {+ fill: #f8f8f8;+ stroke: black;+ stroke-width: 1;+}+svg.hi-location-view path.sinks {+ fill: #f8f8f8;+ stroke: black;+ stroke-width: 1;+}diff --git a/src/hi/static/js/main.js b/src/hi/static/js/main.jsindex 9388107f..cb75ff71 100644--- a/src/hi/static/js/main.js+++ b/src/hi/static/js/main.js@@ -6,6 +6,8 @@isEditMode: ( gHiViewMode == 'edit' ), // Set by server to keep front-end in sync with back-endLOCATION_VIEW_AREA_SELECTOR: '#hi-location-view-main',LOCATION_VIEW_SVG_CLASS: 'hi-location-view',+ LOCATION_VIEW_SVG_SELECTOR: '.hi-location-view',+ LOCATION_VIEW_BASE_SELECTOR: '.hi-location-view-base',BASE_SVG_SELECTOR: '#hi-location-view-main > svg',HIGHLIGHTED_CLASS: 'highlighted',ATTRIBUTE_CONTAINER_SELECTOR: '.hi-attribute',diff --git a/src/hi/static/js/svg-location.js b/src/hi/static/js/svg-location.jsindex 255bb810..9bfc752d 100644--- a/src/hi/static/js/svg-location.js+++ b/src/hi/static/js/svg-location.js@@ -178,9 +178,8 @@return;}- if ( $(event.target).hasClass( Hi.LOCATION_VIEW_SVG_CLASS ) ) {- if ( Hi.DEBUG ) { console.log( `Click [${MODULE_NAME}]`, event ); }- gSelectedLocationViewSvg = event.target;+ if ( $(event.target).closest( Hi.LOCATION_VIEW_BASE_SELECTOR ).length > 0 ) {+ gSelectedLocationViewSvg = $(event.target).closest( Hi.LOCATION_VIEW_SVG_SELECTOR );clearTransformData();event.preventDefault();event.stopImmediatePropagation();