Skip to content

Commit

Permalink
README work
Browse files Browse the repository at this point in the history
  • Loading branch information
Klortho committed Mar 15, 2016
1 parent 3422964 commit 659ce7b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 39 deletions.
27 changes: 13 additions & 14 deletions Implementation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Notes on the implementation of dtd-diagram
# Implementation of dtd-diagram

# Managing geometry
Here are some random notes on a few implementation details -- these are not
intended to be comprehensive.


## Managing geometry

The geometry of the display is captured by several separate Box objects,
with each box recording top, bottom, left, and right in the SVG
Expand All @@ -18,7 +22,7 @@ state after the click. Here they are:
around.


# Data models
## Data models

The DTD data and the display tree data are held in a separate data structures.
This is necessary, because a given element might appear in several places in the
Expand All @@ -36,13 +40,13 @@ See for example:
* [<name>](http://jatspan.org/niso/publishing-1.1d3/#p=nfd-name) - note
the sub-hierarchy with surname and given-names

## Globals
### Globals

* DtdDiagram.diagrams_array - an array of all of the diagrams
* DtdDiagram.diagrams_hash - an object whose keys are the container ids for the
diagrams

#### In-memory tree
##### In-memory tree

For each diagram, there is an in-memory tree of nodes that has the following
properties:
Expand All @@ -63,7 +67,7 @@ The diagram will store:
root can be retrieved from this, with index corresponding to [0]


## The diagram object
### The diagram object

Here's a comprehensive reference list of all of the properties of the
diagram object.
Expand Down Expand Up @@ -114,7 +118,7 @@ diagram object.
* viewport - maintained by Canvas, used in transitioning the drawing as a whole


# Managing state
## Managing state

This module maintains/uses these diagram object properties:

Expand All @@ -126,7 +130,7 @@ This module maintains/uses these diagram object properties:
* src_node_addr - relative to the current_root!!
* src_node

## History state object
### History state object

The history.state object has all the information needed to recreate (to the
extent necessary) the same in-memory tree of nodes, with the same original
Expand All @@ -151,7 +155,7 @@ For example:
}
```

## URL state information
### URL state information

Some, but not all, of the state information is also encoded in the URL.
The URL will be maintained such that, if somebody loads that URL in a pristine
Expand All @@ -174,8 +178,3 @@ current_roots at the time the URL was generated*. For `d1`:
* current_root_name = "article" - the name of the current_root
* ec_state = "AF1b" - expand/collapse state, starting at current_root
* src_node_addr = "7uI" - address of source node relative to current_root.





2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ following pages, for examples of what Near & Far diagrams look like.

***[Implementation](Implementation.md)***

***[To do list](to-do.md)***
***[Current status and to-do list](status-to-do.md)***


## Getting started
Expand Down
19 changes: 10 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var js_sources = [
var sass_src = src + '/*.scss';


gulp.task('default',
gulp.task('default',
['bower', 'test', 'concat', 'uglify', 'sass', 'inject']);

gulp.task('bower', function() {
Expand Down Expand Up @@ -85,7 +85,7 @@ gulp.task('inject', function () {
return gulp.src('./index.html')
.pipe(inject(
gulp.src(
js_sources,
js_sources,
{ read: false }
),
{ relative: true }
Expand All @@ -96,22 +96,23 @@ gulp.task('inject', function () {

// The following are not run by default

// Run `gulp watch` to set up a service that watches for changes, and
// Run `gulp watch` to set up a service that watches for changes, and
// automagically regenerates the product files
gulp.task('watch', function() {
gulp.watch(js_src, ['concat', 'uglify']);
gulp.watch(sass_src, ['sass']);
});

// Deploy to gh-pages.
gulp.task('deploy', function() {
return gulp.src('./dist/**/*')
.pipe(gh_pages());
});
// FIXME: this is not working yet.
//// Deploy to gh-pages.
//gulp.task('deploy', function() {
// return gulp.src('./dist/**/*')
// .pipe(gh_pages());
//});

gulp.task('clean', function () {
return del([
'dist',
'dist',
'.publish',
'.sass-cache',
]);
Expand Down
26 changes: 11 additions & 15 deletions to-do.md → status-to-do.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# To do
# Current status and to-do list

This toy project has been a catalyst for me learning a lot of new (to me)
JavaScript technologies. My goal now, though, is to try to wrap it up
quickly and move on to some other, more practical projects.
This toy project has been a catalyst for me learning a lot of
JavaScript technologies.


## First things first

* This is good enough for now; do a release!!!
* Integrate with jatdoc


## State handling
Expand Down Expand Up @@ -58,9 +63,6 @@ Check these things:
};





## Miscellaneous

* Make sure we update to the layout-bug-fixed version of d3-flextree
Expand Down Expand Up @@ -95,22 +97,16 @@ In the JATS DTDs, the content models are often overly complex.

## Project management

* Switch to Grunt!
* Get a gh-pages target working properly. Right now it doesn't work at all.
* Maybe try some scaffolding tool like Yeoman, to see how they do it.
* I want to keep dist/ out of the repo, or, at least, out of whatever branch
that I'm working on, so that I don't always see it as changed
in my `git status`.
* But the gh-pages demo requires the generated css file (but not the generated
JS -- I'm using gulp-inject to put script tags to the sources in index.html)
* Presumably npm and bower registries will require all the
product files to be in *some* branch, and probably master
* And, it would be nice for first-time visitors to be able to grab the latest
working version from the master branch.
* Right now:
* dist/ is not in master
* I have a `gulp deploy` task set up, that pushes dist/ to gh-pages,
locally and remote. But ***I don't understand how it works***, and
I don't think I have it set up correctly.
* It is not ideal, because doesn't satisfy all the nice-to-haves above.
* Whatever I come up with here should be back-ported to d3-flextree.


0 comments on commit 659ce7b

Please sign in to comment.