Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Commit

Permalink
Add header comments and license information (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
baldram authored Aug 27, 2018
1 parent 7a797cf commit 42aa74a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
* and https://npm.runkit.com/d3-random
* <p>
* Alternatively I could simply use the `gwt-d3` library, but just a very small piece was needed.
*
* <p>
* MIT License
* <p>
* Copyright (c) 2018 <a href="https://github.com/baldram">Marcin Szalomski</a>
* <p>
*/
@JsType
class DataGenerator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
import static elemental2.dom.DomGlobal.document;

/**
* Entry point classes define <code>onModuleLoad()</code>
* A demo project using gwt-leaflet-d3 library.
* Entry point class defining <code>onModuleLoad()</code>.
* <p>
* It's a simple example and the whole application logic is in the main controller.
* In the real life project parts of code would be extracted to separate components and injected here.
* <p>
* MIT License
* <p>
* Copyright (c) 2018 <a href="https://github.com/baldram">Marcin Szalomski</a>
* <p>
*/
public class DemoApp implements EntryPoint {

Expand Down
15 changes: 14 additions & 1 deletion src/main/java/pl/itrack/leafletd3/client/LeafletD3.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* The library initialization.
* Call for required JS dependencies.
*
* The gwt-leaflet-d3 is a plugin for Leaflet.
* It requires also https://github.com/gwidgets/gwty-leaflet as a main Leaflet map base.
*
* <p>
* MIT License
* <p>
* Copyright (c) 2018 <a href="https://github.com/baldram">Marcin Szalomski</a>
* <p>
*/
public class LeafletD3 {

public static void init(LeafletD3LibInjector.CallbackFn callbackFn) {
// TODO: provide the resources bundle together with the gwt-leaflet-d3 lib
// TODO: provide the resources bundled together with the gwt-leaflet-d3 lib
LeafletD3LibInjector.injectScripts(
Stream.of(
"https://d3js.org/d3.v4.min.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@

import java.util.List;

/**
* Dynamically attach to the DOM necessary resources with callback when ready
*
* <p>
* MIT License
* <p>
* Copyright (c) 2018 <a href="https://github.com/baldram">Marcin Szalomski</a>
* <p>
*/
public class LeafletD3LibInjector {

private static boolean processed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
// TODO: to wrap events handling and Pings layer

/**
* The GWT JsInterop wrapper for @Asymmetrik/leaflet-d3 JavaScript library.
* Provides Hexbin functionality as the one here:
* https://github.com/Asymmetrik/leaflet-d3/blob/master/src/js/hexbin/HexbinLayer.js
* L is defined by the Leaflet library (see git://github.com/Leaflet/Leaflet.git for documentation).
*
* <p>
* Note: The "L" is defined by the Leaflet library (see git://github.com/Leaflet/Leaflet.git for documentation).
* and wrapped by https://github.com/gwidgets/gwty-leaflet .
* The L is being extended to add d3-hexbin related functions.
*
* <p>
* MIT License
* <p>
* Copyright (c) 2018 <a href="https://github.com/baldram">Marcin Szalomski</a>
* <p>
*
* @param <T> a data item type (eg. simply <double[] for Latitude and Longitude pair)
*/
@JsType(isNative = true, namespace = "L", name = "hexbinLayer")
Expand Down

0 comments on commit 42aa74a

Please sign in to comment.