Skip to content

Commit

Permalink
Merge pull request #719 from OpenGeoscience/annotation-labels
Browse files Browse the repository at this point in the history
Annotation labels
  • Loading branch information
manthey authored Jul 26, 2017
2 parents 33ee161 + 790a6b9 commit 6798308
Show file tree
Hide file tree
Showing 68 changed files with 2,239 additions and 693 deletions.
17 changes: 17 additions & 0 deletions .pug-lintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"disallowAttributeInterpolation": true,
"disallowClassAttributeWithStaticValue": true,
"disallowDuplicateAttributes": true,
"disallowIdAttributeWithStaticValue": true,
"disallowLegacyMixinCall": true,
"disallowMultipleLineBreaks": true,
"disallowSpacesInsideAttributeBrackets": true,
"requireClassLiteralsBeforeAttributes": true,
"requireIdLiteralsBeforeAttributes": true,
"requireLowerCaseTags": true,
"requireSpaceAfterCodeOperator": true,
"requireStrictEqualityOperators": true,
"validateAttributeSeparator": { "separator": ", ", "multiLineSeparator": ",\n " },
"validateDivTags": true,
"validateTemplateString": true
}
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,9 @@ if(${ESLINT_TESTS})
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND "${NPM_EXECUTABLE}" "run" "lint"
)

add_test(
NAME "puglint"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND "${NPM_EXECUTABLE}" "run" "puglint"
)
endif() # ESLINT_TESTS
13 changes: 6 additions & 7 deletions examples/animation/index.jade → examples/animation/index.pug
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
extends ../common/templates/index.jade
extends ../common/templates/index.pug

block append mainContent
div#controls
#controls
.form-group(title="The data set to plot.")
label(for="dataset") Data Set
select#dataset(param-name="dataset", placeholder="Activity")
option(value="adderall", url="AdderallCities2015.csv" title="9555 points") Adderall
option(value="cities", url="cities.csv" title="30101 points") U.S. Cities
option(value="earthquakes", url="earthquakes.json" title="1.3 million points") Earthquakes
option(value="adderall", url="AdderallCities2015.csv", title="9555 points") Adderall
option(value="cities", url="cities.csv", title="30101 points") U.S. Cities
option(value="earthquakes", url="earthquakes.json", title="1.3 million points") Earthquakes
span#points-loaded
.form-group(title="Number of points. Leave blank for the entire original data set. If a smaller number, only a subset of points will be shown. If a larger number, some of the data will be duplicated with random offsets.")
label(for="points") Number of Points
input#points(type="number" min="1" step="100")
input#points(type="number", min="1", step="100")
span#points-shown
.form-group.style-list
label Styles to animate:
Expand Down Expand Up @@ -57,4 +57,3 @@ block append mainContent
span Avg. Update 
span#timing-update 0
span  ms

100 changes: 0 additions & 100 deletions examples/annotations/index.jade

This file was deleted.

180 changes: 180 additions & 0 deletions examples/annotations/index.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
extends ../common/templates/index.pug

block append mainContent
#controls
.form-group.annotationtype(title='Select the type of annotation to add.')
.shortlabel Add
button#rectangle.lastused(next='polygon') Rectangle
button#polygon(next='point') Polygon
button#point(next='line') Point
button#line(next='rectangle') Line
.form-group
#instructions(annotation='none')
.annotation.none
.annotation.polygon Left-click points in the polygon. Double click, right click, or click the starting point to close the polygon.
.annotation.rectangle Left click-and-drag or left click opposite corners to draw a rectangle.
.annotation.point Left click to create a point.
.annotation.line Left-click points in the line. Double click, right click, or click the starting point to end the line.
.form-group(title='If enabled, left-click to add another annotation, and right-click to switch annotation type. Otherwise, you must click a button above.')
label(for='clickadd') Click to add annotation
input#clickadd(param-name='clickadd', type='checkbox', placeholder='true', checked='checked')
.form-group(title='If enabled, immediately after adding one annotation, you can add another without either left-clicking or selecting a button.')
label(for='keepadding') Keep adding annotations
input#keepadding(param-name='keepadding', type='checkbox', placeholder='false')
.form-group(title='If disabled, hide all annotation labels.')
label(for='showLabels') Show annotation labels
input#showLabels(param-name='labels', type='checkbox', placeholder='true')
.form-group#annotationheader
.shortlabel Created Annotations
a.entry-remove-all(action='remove-all', title='Delete all annotations') ✖
.form-group
#annotationlist
.entry#sample
span.entry-name Sample
a.entry-edit(action='edit', title='Edit name and properties') ✎
a.entry-remove(action='remove', title='Delete this annotation') ✖
.form-group
textarea#geojson(type='textarea', rows=15, autocomplete='off',
autocorrect='off', autocapitalize='off', spellcheck='false')

#editdialog.modal.fade
.modal-dialog
form.modal-content
.modal-header
button.close(type='button', data-dismiss='modal') ×
h4.modal-title Edit Annotation
.modal-body
.row
.col-md-6
.form-group
label(for='edit-name') Name
input#edit-name(option='name')
.form-group
label(for='edit-description') Description
input#edit-description(option='description', type='textarea')
.form-group(annotation-types='point')
label(for='edit-radius') Radius
input#edit-radius(option='radius', format='positive')
.form-group(annotation-types='point', title='Set to "false" to disable, "true" to use the specified radius at the current zoom, or a zoom level to use the specified radius at that zoom level.')
label(for='edit-scaled') Scale with Zoom
input#edit-radius(option='scaled', format='booleanOrNumber')
.form-group(annotation-types='point polygon rectangle')
label(for='edit-fill') Fill
select#edit-stroke(option='fill', format='boolean')
option(value='true') Yes
option(value='false') No
.form-group(annotation-types='point polygon rectangle')
label(for='edit-fillColor') Fill Color
input#edit-fillColor(option='fillColor', format='color')
.form-group(annotation-types='point polygon rectangle')
label(for='edit-fillOpacity') Fill Opacity
input#edit-fillOpacity(option='fillOpacity', format='opacity')
.form-group(annotation-types='point polygon rectangle')
label(for='edit-stroke') Stroke
select#edit-stroke(option='stroke', format='boolean')
option(value='true') Yes
option(value='false') No
.form-group(annotation-types='point polygon rectangle line')
label(for='edit-strokeWidth') Stroke Width
input#edit-strokeWidth(option='strokeWidth', format='positive')
.form-group(annotation-types='point polygon rectangle line')
label(for='edit-strokeColor') Stroke Color
input#edit-strokeColor(option='strokeColor', format='color')
.form-group(annotation-types='point polygon rectangle line')
label(for='edit-strokeOpacity') Stroke Opacity
input#edit-strokeOpacity(option='strokeOpacity', format='opacity')
.form-group(annotation-types='line')
label(for='edit-closed') Closed
select#edit-closed(option='closed', format='boolean')
option(value='true') Yes
option(value='false') No
.form-group(annotation-types='line')
label(for='edit-lineCap') Line End Caps
select#edit-lineCap(option='lineCap', format='text')
option(value='butt') Butt
option(value='round') Round
option(value='square') Square
.form-group(annotation-types='line')
label(for='edit-lineJoin') Line Joins
select#edit-lineJoin(option='lineJoin', format='text')
option(value='miter') Miter
option(value='bevel') Bevel
option(value='round') Round
option(value='miter-clip') Miter-Clip
.col-md-6
//- label
.form-group(title='The label defaults to the annotation name')
label(for='edit-label') Label
input#edit-label(option='label')
.form-group(annotation-types='all', title='The label will only be shown if both this and the global option are selected')
label(for='edit-showLabel') Show Label
select#edit-showLabel(option='showLabel', format='boolean', optiontype='option')
option(value='true') Yes
option(value='false') No
.form-group(annotation-types='all', title='This is of the form [italic|oblique] [small-caps] [bold|bolder|lighter|<weight>] [<stretch>] <size>[/<line height>] <family>')
label(for='edit-font') Font
input#edit-font(option='font', optiontype='label')
.form-group(annotation-types='all', title='This applies to both the filled text and the stroke')
label(for='edit-textOpacity') Label Opacity
input#edit-textOpacity(option='textOpacity', format='opacity', optiontype='label')
.form-group(annotation-types='all', title='The color of the filled text. Use an rgba() form to specify opacity.')
label(for='edit-color') Fill Color
input#edit-color(option='color', format='color', optiontype='label')
.form-group(annotation-types='all', title='The color of a stroke around the text. If used with Fill Color, this adds a perimeter half the Stroke Width outside of the text. Use an rgba() form to specify opacity.')
label(for='edit-textStrokeColor') Stroke Color
input#edit-textStrokeColor(option='textStrokeColor', format='textStrokeColor', optiontype='label')
.form-group(annotation-types='all')
label(for='edit-textStrokeWidth') Stroke Width
input#edit-textStrokeWidth(option='textStrokeWidth', format='numberOrBlank', optiontype='label')
//- positioning
.form-group(annotation-types='all', title='Horizontal alignment')
label(for='edit-textAlign') Horizontal Align.
select#edit-textAlign(option='textAlign', format='text', optiontype='label')
option(value='center') Center
option(value='start') Start
option(value='end') End
option(value='left') Left
option(value='right') Right
.form-group(annotation-types='all', title='Vertical alignment')
label(for='edit-textBaseline') Vertical Align.
select#edit-textAlign(option='textBaseline', format='text', optiontype='label')
option(value='middle') Middle
option(value='top') Top
option(value='hanging') Hanging
option(value='alphabetic') Alphabetic
option(value='ideographic') Ideographic
option(value='bottom') Bottom
.form-group(annotation-types='all')
label(for='edit-rotateWithMap') Rotate with Map
select#edit-rotateWithMap(option='rotateWithMap', format='boolean', optiontype='label')
option(value='false') No
option(value='true') Yes
.form-group(annotation-types='all')
label(for='edit-rotation') Rotation
input#edit-rotation(option='rotation', format='angle', optiontype='label')
.form-group(annotation-types='all', title='Set to "false" to disable, "true" to use the specified font size at the current zoom, or a zoom level to use the specified font size at that zoom level.')
label(for='edit-textScaled') Base Scale
input#edit-textScaled(option='textScaled', format='booleanOrNumber', optiontype='label')
.form-group(annotation-types='all', title='This is the x, y offset of the label in pixels from its default position before rotation and scale. Example: "5, -4"')
label(for='edit-offset') Offset
input#edit-offset(option='offset', format='coordinate2', optiontype='label')
//- shadow options
.form-group(annotation-types='all')
label(for='edit-shadowColor') Shadow Color
input#edit-shadowColor(option='shadowColor', format='shadowColor', optiontype='label')
.form-group(annotation-types='all')
label(for='edit-shadowBlur') Shadow Blur
input#edit-shadowBlur(option='shadowBlur', format='numberOrBlank', optiontype='label')
.form-group(annotation-types='all', title='This is the x, y shadowOffset of the shadow in pixels from its default position before rotation. Example: "5, -4"')
label(for='edit-shadowOffset') Shadow Offset
input#edit-shadowOffset(option='shadowOffset', format='coordinate2', optiontype='label')
.form-group(annotation-types='all', title='Enable to rotate the shadow absed on the label\'s rotation.')
label(for='edit-shadowRotate') Rotate Shadow
select#edit-shadowRotate(option='shadowRotate', format='boolean', optiontype='label')
option(value='false') No
option(value='true') Yes
.form-group
#edit-validation-error
.modal-footer
button.btn.btn-sm.btn-primary#edit-update(type='submit') Update
button.btn.btn-sm.btn-secondary(data-dismiss='modal') Cancel
2 changes: 1 addition & 1 deletion examples/annotations/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
position: absolute;
left: 10px;
top: 80px;
z-index: 1;
z-index: 1000;
border-radius: 5px;
border: 1px solid grey;
box-shadow: 1px 1px 3px black;
Expand Down
Loading

0 comments on commit 6798308

Please sign in to comment.