Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Release v1.0.0 (#1)
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
thinkh authored Jul 16, 2019
2 parents dccb4ac + 91eec8a commit 981f6df
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 64 deletions.
36 changes: 24 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ jobs:
build:
working_directory: ~/phovea
docker:
- image: caleydo/phovea_circleci_python:v1.0
tags:
- /v\d+.\d+.\d+.*/
- image: caleydo/phovea_circleci_python:v2.0
steps:
- checkout
- run:
command: |
(!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
- restore_cache:
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
key: deps3-{{ checksum "package.json" }}
- run:
name: install-npm-wee
command: npm install
Expand All @@ -21,14 +19,14 @@ jobs:
command: |
(grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf
- save_cache:
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
key: deps3-{{ checksum "package.json" }}
paths:
- ./node_modules
- run: #install all dependencies
name: install-npm-wee2
command: npm install
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
key: deps1-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
- run:
name: install-pip-wee
command: |
Expand All @@ -37,7 +35,7 @@ jobs:
pip install -r requirements_dev.txt
pip install -r requirements.txt
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
key: deps1-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
paths:
- ~/venv
- run: #force update of VCS dependencies?
Expand All @@ -46,10 +44,24 @@ jobs:
. ~/venv/bin/activate
pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
- run:
name: dist
name: build
command: |
. ~/venv/bin/activate
npm run dist
- store_artifacts:
path: dist
prefix: dist
npm run build
workflows:
version: 2
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
tdp_matomo [![Phovea][phovea-image]][phovea-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
tdp_matomo [![Phovea][phovea-image]][phovea-url] [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]
=====================

Matomo tracking for TDP applications
Matomo tracking for TDP applications based on provenance graph commands.

Configuration
------------

The tracking starts when a URL to a Matomo backend is set in the `config.js`.
The site ID corresponds with the Matomo site.

```js
{
"matomo": {
"url": "https://matomo.my-example-domain.com/", // matomo url with a trailing slash
"site": "1"
}
}
```

### Provenance Commands

The tracked default provenance commands from [tdp_core](https://github.com/datavisyn/tdp_core) are defined in [actions.ts](./src/actions.ts).

Add a list of custom events when initializing the tracking:

```ts
const trackableActions: ITrackableAction[] = [
// id = phovea extension id
{id: 'targidCreateView', event: {category:'view', action: 'create'}},
];
trackApp(app, trackableActions);
```


Installation
------------
Expand Down Expand Up @@ -38,7 +68,5 @@ This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform
[phovea-url]: https://phovea.caleydo.org
[npm-image]: https://badge.fury.io/js/tdp_matomo.svg
[npm-url]: https://npmjs.org/package/tdp_matomo
[travis-image]: https://travis-ci.org/datavisyn/tdp_matomo.svg?branch=master
[travis-url]: https://travis-ci.org/datavisyn/tdp_matomo
[daviddm-image]: https://david-dm.org/datavisyn/tdp_matomo/status.svg
[daviddm-url]: https://david-dm.org/datavisyn/tdp_matomo
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "tdp_matomo",
"description": "Matomo tracking for TDP applications",
"homepage": "https://datavisyn.io",
"version": "1.0.0-SNAPSHOT",
"version": "1.0.0",
"author": {
"name": "Datavisyn GmbH",
"name": "datavisyn GmbH",
"email": "[email protected]",
"url": "https://datavisyn.io"
},
Expand Down Expand Up @@ -71,43 +71,43 @@
"node": ">= 6"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
"awesome-typescript-loader": "3.0.3",
"cache-loader": "1.2.0",
"css-loader": "0.26.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"@types/jasmine": "2.5.47",
"awesome-typescript-loader": "3.1.2",
"css-loader": "0.28.0",
"extract-loader": "0.1.0",
"ifdef-loader": "2.0.0",
"file-loader": "0.10.0",
"fork-ts-checker-webpack-plugin": "0.2.9",
"html-loader": "0.4.4",
"imports-loader": "0.7.0",
"extract-text-webpack-plugin": "2.1.0",
"file-loader": "0.11.1",
"html-loader": "0.4.5",
"imports-loader": "0.7.1",
"jasmine": "2.5.3",
"json-loader": "0.5.4",
"karma": "1.4.0",
"karma": "1.5.0",
"karma-chrome-launcher": "2.0.0",
"karma-firefox-launcher": "1.0.0",
"karma-firefox-launcher": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-junit-reporter": "2.0.0",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.2",
"karma-webpack": "2.0.3",
"mkdirp": "0.5.1",
"node-sass": "4.5.0",
"node-sass": "4.7.2",
"null-loader": "0.1.1",
"raw-loader": "0.5.1",
"sass-loader": "5.0.0",
"style-loader": "0.13.1",
"sass-loader": "6.0.7",
"style-loader": "0.16.1",
"tslib": "1.9.0",
"tslint": "5.9.1",
"typedoc": "0.11.1",
"typescript": "2.7.2",
"url-loader": "0.5.8",
"webpack": "2.3.3",
"webpack-dev-server": "2.4.2",
"cache-loader": "1.2.0",
"ifdef-loader": "2.0.0",
"fork-ts-checker-webpack-plugin": "0.4.1",
"thread-loader": "1.1.2",
"ts-loader": "3.1.1",
"tslib": "1.5.0",
"tslint": "4.4.2",
"typedoc": "0.7.2",
"typescript": "2.2.0",
"url-loader": "0.5.7",
"webpack": "2.2.1",
"webpack-dev-server": "2.4.2"
"ts-loader": "4.0.1"
},
"dependencies": {
"tdp_core": "github:datavisyn/tdp_core#develop"
"tdp_core": "github:datavisyn/tdp_core#semver:^5.2.0"
}
}
27 changes: 27 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {IMatomoEvent} from './matomo';

/**
* Map of trackable actions
* key = phovea extension id
*/
export const trackableActions = new Map<string, IMatomoEvent>();

// custom event
trackableActions.set('runChain', {category:'provenance', action: 'runChain'});

// from tdp_core\src\internal\cmds.ts
trackableActions.set('tdpInitSession', {category:'session', action: 'init'});
trackableActions.set('tdpSetParameter', {category:'view', action: 'setParameter'});

// from tdp_core\src\lineup\internal\scorecmds.ts
trackableActions.set('tdpAddScore', {category:'score', action: 'add'});
trackableActions.set('tdpRemoveScore', {category:'score', action: 'remove'});

// from tdp_core\src\lineup\internal\cmds.ts
trackableActions.set('lineupSetRankingSortCriteria', {category:'lineup', action: 'setRankingSortCriteria'});
trackableActions.set('lineupSetSortCriteria', {category:'lineup', action: 'setRankingSortCriteria'});
trackableActions.set('lineupSetGroupCriteria', {category:'lineup', action: 'setGroupCriteria'});
trackableActions.set('lineupAddRanking', {category:'lineup', action: 'addRanking'});
trackableActions.set('lineupSetColumn', {category:'lineup', action: 'setColumn'});
trackableActions.set('lineupAddColumn', {category:'lineup', action: 'addColumn'});
trackableActions.set('lineupMoveColumn', {category:'lineup', action: 'moveColumn'});
15 changes: 1 addition & 14 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@

import {mixin} from 'phovea_core/src';

export interface IHelloOptions {
name?: string;
}

export function hello(options?: IHelloOptions) {
//merge with default options
options = mixin({
name: 'World'
}, options);
return `Hello ${options.name}`;
}
export * from './matomo';
Loading

0 comments on commit 981f6df

Please sign in to comment.