Skip to content

Commit

Permalink
Merge branch 'master' into update-heatmap-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey authored Jul 12, 2018
2 parents 28aeffb + 5cf489c commit 913b590
Show file tree
Hide file tree
Showing 104 changed files with 16,356 additions and 6,927 deletions.
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
src/vgl/**
src/version.js
src/sha.js
src/util/wigglemaps.js
src/util/distanceGrid.js
dist/**
testing/**
Expand Down
44 changes: 31 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ function(add_geojs_test test_name)
set_property(TEST "notes-report" APPEND PROPERTY DEPENDS "${test_name}")
endfunction()

# set variables for girder.cmake
set(Girder_KEY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/testing/test-data")
set(Girder_DATA_DIR "${GEOJS_DEPLOY_DIR}/data")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/girder.cmake)

add_download_target()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testing/test-runners/geojs_test_runner.py.in
${CMAKE_CURRENT_BINARY_DIR}/test/geojs_test_runner.py
)
Expand All @@ -73,12 +66,37 @@ add_test(
)
set_property(TEST "notes-report" APPEND PROPERTY DEPENDS "notes-reset")

add_custom_target(
data_files
ALL
DEPENDS ${Girder_DOWNLOAD_FILES}
)
add_test(NAME get_data_files COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target data_files)
# Use ExternalData to download all referenced files in tests/external-data
include(ExternalData)
set(ExternalData_URL_TEMPLATES "https://data.kitware.com/api/v1/file/hashsum/%(algo)/%(hash)/download")
set(ExternalData_BINARY_ROOT "${GEOJS_DEPLOY_DIR}/data")
set(ExternalData_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/tests/external-data")
# Get a list of files to download based on the name *.sha512
file(GLOB data_files_list "${ExternalData_SOURCE_ROOT}/*.sha512")
# Obtain the files using ExternalData
foreach(data_file ${data_files_list})
string(REGEX REPLACE "^(.*)\\.sha512$" "\\1" base_file "${data_file}")
ExternalData_Expand_Arguments(data_files tmp DATA{${base_file}})
endforeach()
# Add a target to get the files
ExternalData_Add_Target(data_files)
# For any file that is a .tgz file, expand it after we get it
foreach(data_file ${data_files_list})
string(REGEX REPLACE "^(.*)\\.sha512$" "\\1" base_file "${data_file}")
get_filename_component(base_file "${base_file}" NAME)
get_filename_component(base_fileext "${base_file}" EXT)
if("${base_fileext}" STREQUAL ".tgz")
get_filename_component(base_filename "${base_file}" NAME_WE)
add_custom_command(
TARGET data_files POST_BUILD
DEPENDS "${ExternalData_BINARY_ROOT}/${base_file}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${ExternalData_BINARY_ROOT}/${base_filename}"
COMMAND ${CMAKE_COMMAND} -E chdir "${ExternalData_BINARY_ROOT}/${base_filename}" tar zxf "${ExternalData_BINARY_ROOT}/${base_file}"
)
endif()
endforeach()
# Create a test that gets this target
add_test(NAME get_data_files COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target data_files)

if(HEADLESS_TESTS)
add_test(
Expand Down
13 changes: 0 additions & 13 deletions cmake/configure-js-coverage-test.cmake

This file was deleted.

5 changes: 0 additions & 5 deletions cmake/configure-js-unit-test.cmake

This file was deleted.

127 changes: 0 additions & 127 deletions cmake/girder.cmake

This file was deleted.

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import json
import os
import shutil
import re
import sys
from glob import glob
# from subprocess import check_output

Expand Down Expand Up @@ -73,7 +73,7 @@
# built documents.
#
# The short X.Y version.
version = '0.16.0'
version = json.load(open(os.path.join(toppath, 'package.json')))['version']
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
2 changes: 1 addition & 1 deletion docs/users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ list of libraries used by GeoJS.
+---------------------------+------------+---------------------------+
| `earcut`_ | 2.1 | GL polygon feature |
+---------------------------+------------+---------------------------+
| `jQuery`_ | 2.2 | Core |
| `jQuery`_ | 3.3 | Core |
+---------------------------+------------+---------------------------+

.. table:: External GeoJS dependencies
Expand Down
7 changes: 7 additions & 0 deletions examples/isoline/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"title": "Isolines",
"exampleJs": ["main.js"],
"about": {
"text": "This example shows how to add isolines to a map."
}
}
63 changes: 63 additions & 0 deletions examples/isoline/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Run after the DOM loads
$(function () {
'use strict';

// Create a map object with the OpenStreetMaps base layer.
var map = geo.map({
node: '#map',
center: {
x: -157.965,
y: 21.482
},
zoom: 11
});

// Add a faint osm layer
map.createLayer('osm', {opacity: 0.5});

// Create a feature layer that supports contours
var isolineLayer = map.createLayer('feature', {
features: ['isoline']
});

// Load the data
$.get('../../data/oahu-dense.json').done(function (data) {
// Create an isoline feature
var iso = isolineLayer.createFeature('isoline', {
isoline: {
// Specify our grid data
gridWidth: data.gridWidth,
gridHeight: data.gridHeight,
x0: data.x0,
y0: data.y0,
dx: data.dx,
dy: data.dy,
// Don't plot any values less than zero
min: 0,
// Create a contour line every 50 meters
spacing: 50,
// Make every 4th line heavier and every 4*5 = 20th line heavier yet
levels: [4, 5]
},
style: {
// The data uses -9999 to represent no value; modify it to return null
// instead.
value: function (d) { return d > -9999 ? d : null; },
// level relates to the isoline importance, with 0 being the most
// common and, using the levels specified, a level of 1 being every
// fourth, and 2 every twentieth line. Color the lines differently
// depending on the level
strokeColor: function (v, vi, d) {
return ['grey', 'mediumblue', 'blue'][d.level];
}
}
}).data(data.values).draw();
// Make some values available in the global context so curious people can
// play with them.
window.example = {
map: map,
isolineLayer: isolineLayer,
iso: iso
};
});
});
Binary file added examples/isoline/thumb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 35 additions & 7 deletions external.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
var path = require('path');
var webpack = require('webpack');
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');

module.exports = {
/* webpack 4
mode: 'production',
*/
performance: {hints: false},
cache: true,
context: path.join(__dirname, 'src'),
entry: {
'geo.ext': './vendor.js',
Expand All @@ -18,18 +23,41 @@ module.exports = {
hammerjs: 'hammerjs/hammer.js'
}
},
/* webpack 3 */
plugins: [
new webpack.optimize.UglifyJsPlugin({
new UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
comments: /@(license|copyright)/
parallel: true,
uglifyOptions: {
compress: true,
comments: /@(license|copyright)/
},
sourceMap: true
})
],
/* end webpack 3 */
/* webpack 4
optimization: {
minimizer: [
new UglifyJsPlugin({
include: /\.min\.js$/,
parallel: true,
uglifyOptions: {
compress: true,
comments: /@(license|copyright)/
},
sourceMap: true
})
]
},
*/
module: {
loaders: [{
test: require.resolve('d3'), loader: 'expose?d3'
rules: [{
test: require.resolve('d3'),
use: ['expose-loader?d3']
}, {
test: require.resolve('hammerjs'), loader: 'expose?hammerjs'
test: require.resolve('hammerjs'),
use: ['expose-loader?hammerjs']
}]
}
};
Loading

0 comments on commit 913b590

Please sign in to comment.