27 | Once you've created your Radar you can use this service
28 | to generate an interactive version of your Technology Radar. Not sure how?
29 | Read this first.
30 |
31 |
32 | Building your radar...
33 |
Your Technology Radar will be available in just a few seconds
",
64 | ]
65 |
66 | blip = sanitizer.sanitizeForProtectedSheet(rawBlip, header)
67 | })
68 |
69 | it('strips out script tags from blip descriptions', function () {
70 | expect(blip.description).toEqual('Hello there
heading
')
71 | })
72 |
73 | it('strips out all tags from blip name', function () {
74 | expect(blip.name).toEqual('Hello there blip')
75 | })
76 |
77 | it('strips out all tags from blip status', function () {
78 | expect(blip.isNew).toEqual('true')
79 | })
80 |
81 | it('strips out all tags from blip ring', function () {
82 | expect(blip.ring).toEqual('Adopt')
83 | })
84 |
85 | it('strips out all tags from blip quadrant', function () {
86 | expect(blip.quadrant).toEqual('techniques & tools')
87 | })
88 |
89 | it('trims white spaces in keys and values', function () {
90 | rawBlip = {
91 | ' name': ' Some name ',
92 | ' ring ': ' Some ring name ',
93 | }
94 | blip = sanitizer.sanitize(rawBlip)
95 |
96 | expect(blip.name).toEqual('Some name')
97 | expect(blip.ring).toEqual('Some ring name')
98 | })
99 | })
100 |
--------------------------------------------------------------------------------
/webpack.common.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const webpack = require('webpack')
4 | const path = require('path')
5 | const buildPath = path.resolve(__dirname, 'dist')
6 | const args = require('yargs').argv
7 |
8 | const HtmlWebpackPlugin = require('html-webpack-plugin')
9 | const MiniCssExtractPlugin = require('mini-css-extract-plugin')
10 | const postcssPresetEnv = require('postcss-preset-env')
11 | const cssnano = require('cssnano')
12 |
13 | const env = args.envFile
14 | if (env) {
15 | // Load env file
16 | require('dotenv').config({ path: env })
17 | }
18 |
19 | const common = ['./src/common.js']
20 |
21 | const ASSET_PATH = process.env.ASSET_PATH || '/'
22 |
23 | const plugins = [
24 | new MiniCssExtractPlugin({ filename: '[name].[contenthash].css' }),
25 | new HtmlWebpackPlugin({
26 | template: './src/index.html',
27 | chunks: ['main'],
28 | inject: 'body',
29 | }),
30 | new HtmlWebpackPlugin({
31 | template: './src/error.html',
32 | chunks: ['common'],
33 | inject: 'body',
34 | filename: 'error.html',
35 | }),
36 | new webpack.DefinePlugin({
37 | 'process.env.CLIENT_ID': JSON.stringify(process.env.CLIENT_ID),
38 | 'process.env.API_KEY': JSON.stringify(process.env.API_KEY),
39 | 'process.env.ENABLE_GOOGLE_AUTH': JSON.stringify(process.env.ENABLE_GOOGLE_AUTH),
40 | 'process.env.GTM_ID': JSON.stringify(process.env.GTM_ID),
41 | }),
42 | ]
43 |
44 | module.exports = {
45 | context: __dirname,
46 | entry: {
47 | common: common,
48 | },
49 |
50 | output: {
51 | path: buildPath,
52 | publicPath: ASSET_PATH,
53 | filename: '[name].[contenthash].js',
54 | assetModuleFilename: 'images/[name][ext]',
55 | },
56 | resolve: {
57 | extensions: ['.js', '.ts'],
58 | fallback: {
59 | fs: false,
60 | },
61 | },
62 |
63 | module: {
64 | rules: [
65 | {
66 | test: /\.js$/,
67 | exclude: /node_modules/,
68 | use: [
69 | {
70 | loader: 'babel-loader',
71 | options: {
72 | presets: ['@babel/preset-env'],
73 | },
74 | },
75 | ],
76 | },
77 | {
78 | test: /\.scss$/,
79 | exclude: /node_modules/,
80 | use: [
81 | 'style-loader',
82 | MiniCssExtractPlugin.loader,
83 | {
84 | loader: 'css-loader',
85 | options: { importLoaders: 1, modules: 'global', url: false },
86 | },
87 | {
88 | loader: 'postcss-loader',
89 | options: {
90 | postcssOptions: {
91 | plugins: [
92 | postcssPresetEnv({ browsers: 'last 2 versions' }),
93 | cssnano({
94 | preset: ['default', { discardComments: { removeAll: true } }],
95 | }),
96 | ],
97 | },
98 | },
99 | },
100 | 'sass-loader',
101 | ],
102 | },
103 | {
104 | test: /\.(eot|otf|ttf|woff|woff2)$/,
105 | type: 'asset/resource',
106 | },
107 | {
108 | test: /\.(png|jpg|jpeg|gif|ico|svg)$/,
109 | exclude: /node_modules/,
110 | type: 'asset/resource',
111 | },
112 | {
113 | test: require.resolve('jquery'),
114 | loader: 'expose-loader',
115 | options: { exposes: ['$', 'jQuery'] },
116 | },
117 | ],
118 | },
119 |
120 | plugins: plugins,
121 | }
122 |
--------------------------------------------------------------------------------
/.circleci/deployment-workflow.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | orbs:
4 | aws-cli: circleci/aws-cli@2.0.6
5 |
6 | executors:
7 | base:
8 | docker:
9 | - image: cimg/node:18.12.1
10 | user: root
11 |
12 | commands:
13 | install-node-packages:
14 | description: Install node packages
15 | steps:
16 | - restore_cache:
17 | key: node-cache-v2-{{ checksum "package-lock.json" }}
18 | - run:
19 | name: Install node packages
20 | command: npm install
21 | - save_cache:
22 | paths:
23 | - ./node_modules
24 | key: node-cache-v2-{{ checksum "package-lock.json" }}
25 | install-node-and-cypress-packages:
26 | description: Install node packages and Cypress dependencies
27 | steps:
28 | - restore_cache:
29 | key: node-cache-with-cypress-v1-{{ checksum "package-lock.json" }}
30 | - run:
31 | name: Install Cypress dependencies
32 | command: |
33 | apt-get update
34 | apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
35 | - run:
36 | name: Install node packages
37 | command: npm install
38 | - save_cache:
39 | paths:
40 | - ./node_modules
41 | - ~/.cache/Cypress
42 | key: node-cache-with-cypress-v1-{{ checksum "package-lock.json" }}
43 | build-and-push:
44 | description: Build and push code to S3 bucket
45 | parameters:
46 | api_key:
47 | type: string
48 | default: ''
49 | client_id:
50 | type: string
51 | default: ''
52 | gtm_id:
53 | type: string
54 | default: ''
55 | bucket_name:
56 | type: string
57 | default: ''
58 | distribution_id:
59 | type: string
60 | default: ''
61 | mode:
62 | type: string
63 | default: ''
64 | steps:
65 | - run:
66 | name: Build code
67 | command: API_KEY=<< parameters.api_key >> CLIENT_ID=<< parameters.client_id >> GTM_ID=<< parameters.gtm_id >> npm run build:<>
68 | - aws-cli/setup
69 | - run:
70 | name: Sync build artifacts to S3
71 | command: aws s3 cp --recursive dist "s3://<< parameters.bucket_name >>/"
72 | - run:
73 | name: Create invalidation in CloudFront
74 | command: aws cloudfront create-invalidation --distribution-id << parameters.distribution_id >> --paths '/*'
75 |
76 | jobs:
77 | e2e-tests:
78 | executor: base
79 | steps:
80 | - checkout
81 | - install-node-and-cypress-packages
82 | - run:
83 | name: Run e2e test cases
84 | command: API_KEY=$LOCAL_API_KEY ./run_e2e_tests.sh $LOCAL_TEST_URL
85 | qa-deployment:
86 | executor: base
87 | steps:
88 | - checkout
89 | - install-node-packages
90 | - build-and-push:
91 | api_key: $QA_API_KEY
92 | client_id: $QA_CLIENT_ID
93 | gtm_id: $QA_GTM_ID
94 | bucket_name: $QA_BUCKET_NAME
95 | distribution_id: $QA_DISTRIBUTION_ID
96 | mode: dev
97 | prod-deployment:
98 | executor: base
99 | steps:
100 | - checkout
101 | - setup_remote_docker:
102 | version: 20.10.12
103 | docker_layer_caching: true
104 | - install-node-packages
105 | - build-and-push:
106 | api_key: $PROD_API_KEY
107 | client_id: $PROD_CLIENT_ID
108 | gtm_id: $PROD_GTM_ID
109 | bucket_name: $PROD_BUCKET_NAME
110 | distribution_id: $PROD_DISTRIBUTION_ID
111 | mode: prod
112 | - run:
113 | name: Build and push Docker image to DockerHub
114 | command: ./docker_push.sh
115 |
116 | workflows:
117 | build-and-deploy:
118 | jobs:
119 | - e2e-tests:
120 | filters:
121 | branches:
122 | only: master
123 | - approve-qa-deployment:
124 | type: approval
125 | requires:
126 | - e2e-tests
127 | - qa-deployment:
128 | requires:
129 | - approve-qa-deployment
130 | - approve-prod-deployment:
131 | type: approval
132 | requires:
133 | - qa-deployment
134 | - prod-deployment:
135 | requires:
136 | - approve-prod-deployment
137 |
--------------------------------------------------------------------------------
/src/stylesheets/_header.scss:
--------------------------------------------------------------------------------
1 | @import 'colors';
2 | @import 'featuretoggles';
3 | @import 'mediaqueries';
4 |
5 | header {
6 | text-align: center;
7 | }
8 |
9 | .radar-title,
10 | .buttons-group,
11 | #alternative-buttons {
12 | display: flex;
13 | flex-direction: row;
14 | justify-content: flex-start;
15 | align-items: center;
16 | align-content: space-between;
17 | }
18 |
19 | .radar-title {
20 | background-color: $grey-light;
21 | padding: 30px 0;
22 |
23 | display: table;
24 | margin: auto;
25 | width: 100%;
26 |
27 | .radar-title__text {
28 | display: table-cell;
29 | width: 70%;
30 |
31 | text-align: left;
32 | padding-left: 10%;
33 |
34 | h1 {
35 | font-size: 55px;
36 | font-weight: 900;
37 | letter-spacing: -0.04em;
38 | line-height: 0.8em;
39 | margin: 0;
40 | text-transform: uppercase;
41 | }
42 | }
43 |
44 | .radar-title__logo {
45 | flex: 0 0 30%;
46 | margin-left: auto;
47 |
48 | width: 30%;
49 | display: table-cell;
50 | vertical-align: middle;
51 |
52 | a {
53 | border-bottom: none;
54 | }
55 |
56 | img {
57 | vertical-align: middle;
58 | width: 34%;
59 | }
60 | }
61 | }
62 |
63 | .quadrant-btn--group,
64 | .multiple-sheet-button-group {
65 | text-align: left;
66 | padding-left: 10%;
67 | }
68 |
69 | .print-radar-btn,
70 | .search-box {
71 | margin-left: auto;
72 | margin-right: 10%;
73 | }
74 |
75 | .buttons-group {
76 | padding: 15px 0 25px;
77 | }
78 |
79 | .home-link {
80 | color: $pink;
81 | margin-bottom: 10px;
82 | line-height: normal;
83 | cursor: pointer;
84 | display: inline-block;
85 | font-size: $baseFont;
86 | text-align: left;
87 | width: 80%;
88 | }
89 |
90 | .button {
91 | font-size: $baseFont;
92 | text-transform: capitalize;
93 | margin-right: 20px;
94 | border-radius: 2px;
95 | padding: 10px 20px;
96 | cursor: pointer;
97 | transition: all 0.2s ease-out;
98 |
99 | background-color: $grey-light;
100 | color: $black;
101 |
102 | &.no-capitalize {
103 | text-transform: none;
104 | }
105 |
106 | &:hover,
107 | &.selected {
108 | transform: translate(0, -2px);
109 | opacity: 0.85;
110 |
111 | &.first {
112 | color: white;
113 | background-color: $green;
114 | }
115 |
116 | &.second {
117 | color: white;
118 | background-color: $blue;
119 | }
120 |
121 | &.third {
122 | color: white;
123 | background-color: $orange;
124 | }
125 |
126 | &.fourth {
127 | color: white;
128 | background-color: $violet;
129 | }
130 | }
131 |
132 | &.full-view {
133 | &.first {
134 | background-color: $green;
135 | color: $white;
136 | }
137 |
138 | &.second {
139 | background-color: $blue;
140 | color: $white;
141 | }
142 |
143 | &.third {
144 | background-color: $orange;
145 | color: $white;
146 | }
147 |
148 | &.fourth {
149 | background-color: $violet;
150 | color: $white;
151 | }
152 | }
153 | }
154 |
155 | #alternative-buttons {
156 | margin-bottom: 50px;
157 |
158 | .highlight {
159 | border-bottom: none;
160 | font-weight: bold;
161 | }
162 |
163 | p {
164 | font-size: 16px;
165 | font-weight: 700;
166 | margin-top: 0;
167 | margin-bottom: 10px;
168 | }
169 |
170 | .multiple-sheet-button {
171 | margin-right: 10px;
172 | }
173 |
174 | .search-radar {
175 | border: 1px solid #aaa;
176 | background-color: inherit;
177 | background-image: url('/images/search-logo-2x.svg');
178 | background-repeat: no-repeat;
179 | background-position: 10px;
180 | }
181 |
182 | input {
183 | padding-left: 35px;
184 | width: 275px;
185 | }
186 | }
187 |
188 | .ui-autocomplete {
189 | width: 275px !important;
190 |
191 | .ui-autocomplete-quadrant {
192 | font-size: 14px;
193 | font-weight: 600;
194 | padding: 5px;
195 | }
196 |
197 | .ui-menu-item {
198 | white-space: normal;
199 | font-size: 14px;
200 | font-weight: 400;
201 |
202 | .ui-menu-item-wrapper {
203 | padding: 0 10px;
204 | }
205 | }
206 | }
207 |
208 | @if $UIRefresh2022 {
209 | header {
210 | height: 80px;
211 | display: flex;
212 | align-items: center;
213 | justify-content: center;
214 |
215 | a {
216 | display: block;
217 | border-bottom: none;
218 |
219 | img {
220 | height: 20px;
221 | width: auto;
222 | }
223 | }
224 | }
225 | }
226 |
--------------------------------------------------------------------------------
/src/util/googleAuth.js:
--------------------------------------------------------------------------------
1 | /* global gapi */
2 | const d3 = require('d3')
3 |
4 | // Client ID and API key from the Developer Console
5 | var CLIENT_ID = process.env.CLIENT_ID
6 | var API_KEY = process.env.API_KEY
7 |
8 | // Array of API discovery doc URLs for APIs used by the quickstart
9 | var DISCOVERY_DOCS = ['https://sheets.googleapis.com/$discovery/rest?version=v4']
10 |
11 | // Authorization scopes required by the API multiple scopes can be
12 | // included, separated by spaces.
13 | var SCOPES = 'https://www.googleapis.com/auth/spreadsheets.readonly'
14 |
15 | const GoogleAuth = function () {
16 | const self = {}
17 | self.forceLogin = false
18 | self.isAuthorizedCallbacks = []
19 | self.isLoggedIn = undefined
20 | self.userEmail = ''
21 | let tokenClient
22 | self.gapiInitiated = false
23 | self.gsiInitiated = false
24 |
25 | self.loadAuthAPI = function () {
26 | !self.gapiInitiated &&
27 | self.content.append('script').attr('src', 'https://apis.google.com/js/api.js').on('load', self.handleClientLoad)
28 | }
29 |
30 | self.loadGSI = function () {
31 | !self.gsiInitiated &&
32 | self.content
33 | .append('script')
34 | .attr('src', 'https://accounts.google.com/gsi/client')
35 | .on('load', function () {
36 | self.gsiLogin()
37 | })
38 | }
39 |
40 | self.loadGoogle = function (forceLogin = false, callback) {
41 | self.loadedCallback = callback
42 | self.forceLogin = forceLogin
43 | self.content = d3.select('body')
44 |
45 | if (!self.forceLogin) {
46 | self.loadAuthAPI()
47 | } else {
48 | self.handleClientLoad()
49 | self.gsiLogin(forceLogin)
50 | }
51 | }
52 |
53 | function parseJwt(token) {
54 | var base64Url = token.split('.')[1]
55 | var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
56 | var jsonPayload = decodeURIComponent(
57 | window
58 | .atob(base64)
59 | .split('')
60 | .map(function (c) {
61 | return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
62 | })
63 | .join(''),
64 | )
65 |
66 | return JSON.parse(jsonPayload)
67 | }
68 |
69 | self.gsiCallback = async function (credentialResponse) {
70 | let jwToken
71 | if (credentialResponse) {
72 | jwToken = parseJwt(credentialResponse.credential)
73 | }
74 |
75 | tokenClient = await window.google.accounts.oauth2.initTokenClient({
76 | client_id: CLIENT_ID,
77 | scope: SCOPES,
78 | callback: '',
79 | prompt: self.forceLogin ? 'select_account' : '',
80 | hint: self.forceLogin ? '' : jwToken?.email,
81 | })
82 |
83 | self.gsiInitiated = true
84 | self.prompt()
85 | }
86 |
87 | self.gsiLogin = async function (forceLogin = false) {
88 | self.forceLogin = forceLogin
89 | window.google.accounts.id.initialize({
90 | client_id: CLIENT_ID,
91 | callback: self.gsiCallback,
92 | auto_select: self.forceLogin ? false : true,
93 | cancel_on_tap_outside: false,
94 | })
95 | if (!self.forceLogin) {
96 | window.google.accounts.id.prompt()
97 | } else {
98 | self.gsiCallback()
99 | }
100 | }
101 |
102 | self.handleClientLoad = function () {
103 | gapi.load('client', self.initClient)
104 | }
105 |
106 | self.isAuthorized = function (callback) {
107 | self.isAuthorizedCallbacks.push(callback)
108 | if (self.isLoggedIn !== undefined) {
109 | callback(self.isLoggedIn)
110 | }
111 | }
112 |
113 | self.prompt = async function () {
114 | if (self.gsiInitiated && self.gapiInitiated) {
115 | const token = gapi.client.getToken()
116 | if (token && token.access_token && !self.forceLogin) {
117 | const options = { method: 'GET', headers: { authorization: `Bearer ${token.access_token}` } }
118 | const response = await fetch('https://www.googleapis.com/oauth2/v1/userinfo', options)
119 | const profile = await response.json()
120 | self.userEmail = profile.email
121 | self.loadedCallback()
122 | } else {
123 | tokenClient.callback = () => {
124 | self.forceLogin = false
125 | self.prompt()
126 | }
127 | tokenClient.requestAccessToken()
128 | }
129 | }
130 | }
131 |
132 | self.initClient = async function () {
133 | gapi.client
134 | .init({
135 | apiKey: API_KEY,
136 | discoveryDocs: DISCOVERY_DOCS,
137 | scope: SCOPES,
138 | })
139 | .then(() => {
140 | self.gapiInitiated = true
141 | self.loadedCallback()
142 | })
143 | }
144 |
145 | self.getEmail = () => {
146 | return self.userEmail
147 | }
148 |
149 | return self
150 | }
151 |
152 | module.exports = new GoogleAuth()
153 |
--------------------------------------------------------------------------------
/spec/models/radar-spec.js:
--------------------------------------------------------------------------------
1 | const Radar = require('../../src/models/radar')
2 | const Quadrant = require('../../src/models/quadrant')
3 | const Ring = require('../../src/models/ring')
4 | const Blip = require('../../src/models/blip')
5 | const MalformedDataError = require('../../src/exceptions/malformedDataError')
6 | const ExceptionMessages = require('../../src/util/exceptionMessages')
7 |
8 | describe('Radar', function () {
9 | it('has no quadrants by default', function () {
10 | var radar = new Radar()
11 |
12 | expect(radar.quadrants()[0].quadrant).not.toBeDefined()
13 | expect(radar.quadrants()[1].quadrant).not.toBeDefined()
14 | expect(radar.quadrants()[2].quadrant).not.toBeDefined()
15 | expect(radar.quadrants()[3].quadrant).not.toBeDefined()
16 | })
17 |
18 | it('sets the first quadrant', function () {
19 | var quadrant, radar, blip
20 |
21 | blip = new Blip('A', new Ring('First'))
22 | quadrant = new Quadrant('First')
23 | quadrant.add([blip])
24 | radar = new Radar()
25 |
26 | radar.addQuadrant(quadrant)
27 |
28 | expect(radar.quadrants()[0].quadrant).toEqual(quadrant)
29 | expect(radar.quadrants()[0].quadrant.blips()[0].number()).toEqual(1)
30 | })
31 |
32 | it('sets the second quadrant', function () {
33 | var quadrant, radar, blip
34 |
35 | blip = new Blip('A', new Ring('First'))
36 | quadrant = new Quadrant('Second')
37 | quadrant.add([blip])
38 | radar = new Radar()
39 |
40 | radar.addQuadrant(quadrant)
41 |
42 | expect(radar.quadrants()[0].quadrant).toEqual(quadrant)
43 | expect(radar.quadrants()[0].quadrant.blips()[0].number()).toEqual(1)
44 | })
45 |
46 | it('sets the third quadrant', function () {
47 | var quadrant, radar, blip
48 |
49 | blip = new Blip('A', new Ring('First'))
50 | quadrant = new Quadrant('Third')
51 | quadrant.add([blip])
52 | radar = new Radar()
53 |
54 | radar.addQuadrant(quadrant)
55 |
56 | expect(radar.quadrants()[0].quadrant).toEqual(quadrant)
57 | expect(radar.quadrants()[0].quadrant.blips()[0].number()).toEqual(1)
58 | })
59 |
60 | it('sets the fourth quadrant', function () {
61 | var quadrant, radar, blip
62 |
63 | blip = new Blip('A', new Ring('First'))
64 | quadrant = new Quadrant('Fourth')
65 | quadrant.add([blip])
66 | radar = new Radar()
67 |
68 | radar.addQuadrant(quadrant)
69 |
70 | expect(radar.quadrants()[0].quadrant).toEqual(quadrant)
71 | expect(radar.quadrants()[0].quadrant.blips()[0].number()).toEqual(1)
72 | })
73 |
74 | it('throws an error if too many quadrants are added', function () {
75 | var quadrant, radar, blip
76 |
77 | blip = new Blip('A', new Ring('First'))
78 | quadrant = new Quadrant('First')
79 | quadrant.add([blip])
80 | radar = new Radar()
81 |
82 | radar.addQuadrant(quadrant)
83 | radar.addQuadrant(new Quadrant('Second'))
84 | radar.addQuadrant(new Quadrant('Third'))
85 | radar.addQuadrant(new Quadrant('Fourth'))
86 |
87 | expect(function () {
88 | radar.addQuadrant(new Quadrant('Fifth'))
89 | }).toThrow(new MalformedDataError(ExceptionMessages.TOO_MANY_QUADRANTS))
90 | })
91 |
92 | it('throws an error if less than 4 quadrants are added', function () {
93 | var quadrant, radar, blip
94 |
95 | blip = new Blip('A', new Ring('First'))
96 | quadrant = new Quadrant('First')
97 | quadrant.add([blip])
98 | radar = new Radar()
99 |
100 | radar.addQuadrant(quadrant)
101 | radar.addQuadrant(new Quadrant('Second'))
102 | radar.addQuadrant(new Quadrant('Third'))
103 |
104 | expect(function () {
105 | radar.rings()
106 | }).toThrow(new MalformedDataError(ExceptionMessages.LESS_THAN_FOUR_QUADRANTS))
107 | })
108 |
109 | describe('blip numbers', function () {
110 | var firstQuadrant, secondQuadrant, radar, firstRing
111 |
112 | beforeEach(function () {
113 | firstRing = new Ring('Adopt', 0)
114 | firstQuadrant = new Quadrant('First')
115 | secondQuadrant = new Quadrant('Second')
116 | firstQuadrant.add([new Blip('A', firstRing), new Blip('B', firstRing)])
117 | secondQuadrant.add([new Blip('C', firstRing), new Blip('D', firstRing)])
118 | radar = new Radar()
119 | })
120 |
121 | it('sets blip numbers starting on the first quadrant', function () {
122 | radar.addQuadrant(firstQuadrant)
123 |
124 | expect(radar.quadrants()[0].quadrant.blips()[0].number()).toEqual(1)
125 | expect(radar.quadrants()[0].quadrant.blips()[1].number()).toEqual(2)
126 | })
127 |
128 | it('continues the number from the previous quadrant set', function () {
129 | radar.addQuadrant(firstQuadrant)
130 | radar.addQuadrant(secondQuadrant)
131 |
132 | expect(radar.quadrants()[1].quadrant.blips()[0].number()).toEqual(3)
133 | expect(radar.quadrants()[1].quadrant.blips()[1].number()).toEqual(4)
134 | })
135 | })
136 |
137 | describe('alternatives', function () {
138 | it('returns a provided alternatives', function () {
139 | var radar = new Radar()
140 |
141 | var alternative1 = 'alternative1'
142 | var alternative2 = 'alternative2'
143 |
144 | radar.addAlternative(alternative1)
145 | radar.addAlternative(alternative2)
146 |
147 | expect(radar.getAlternatives()).toEqual([alternative1, alternative2])
148 | })
149 | })
150 |
151 | describe('rings', function () {
152 | var quadrant, radar, firstRing, secondRing, otherQuadrant
153 |
154 | beforeEach(function () {
155 | firstRing = new Ring('Adopt', 0)
156 | secondRing = new Ring('Hold', 1)
157 | quadrant = new Quadrant('Fourth')
158 | otherQuadrant = new Quadrant('Other')
159 | radar = new Radar()
160 | })
161 |
162 | it('returns an array for a given set of blips', function () {
163 | quadrant.add([new Blip('A', firstRing), new Blip('B', secondRing)])
164 |
165 | radar.addQuadrant(quadrant)
166 | radar.addQuadrant(otherQuadrant)
167 | radar.addQuadrant(otherQuadrant)
168 | radar.addQuadrant(otherQuadrant)
169 |
170 | expect(radar.rings()).toEqual([firstRing, secondRing])
171 | })
172 |
173 | it('has unique rings', function () {
174 | quadrant.add([new Blip('A', firstRing), new Blip('B', firstRing), new Blip('C', secondRing)])
175 |
176 | radar.addQuadrant(quadrant)
177 | radar.addQuadrant(otherQuadrant)
178 | radar.addQuadrant(otherQuadrant)
179 | radar.addQuadrant(otherQuadrant)
180 |
181 | expect(radar.rings()).toEqual([firstRing, secondRing])
182 | })
183 |
184 | it('has sorts by the ring order', function () {
185 | quadrant.add([new Blip('C', secondRing), new Blip('A', firstRing), new Blip('B', firstRing)])
186 |
187 | radar.addQuadrant(quadrant)
188 | radar.addQuadrant(otherQuadrant)
189 | radar.addQuadrant(otherQuadrant)
190 | radar.addQuadrant(otherQuadrant)
191 |
192 | expect(radar.rings()).toEqual([firstRing, secondRing])
193 | })
194 | })
195 | })
196 |
--------------------------------------------------------------------------------
/src/stylesheets/base.scss:
--------------------------------------------------------------------------------
1 | @import 'colors';
2 | @import 'fonts';
3 | @import 'tip';
4 | @import 'form';
5 | @import 'error';
6 | @import 'header';
7 | @import 'footer';
8 | @import 'featuretoggles';
9 | @import 'herobanner';
10 | @import 'mediaqueries';
11 | @import 'layout';
12 | @import 'landingpage';
13 | @import 'loader';
14 | @import 'screen';
15 |
16 | body {
17 | font: 18px 'Open Sans';
18 | opacity: 0;
19 | @if $UIRefresh2022 {
20 | font-family: $baseFontFamily;
21 | opacity: 1;
22 |
23 | h1 {
24 | font-size: 2rem;
25 | font-family: 'Bitter', serif;
26 | text-transform: none;
27 | letter-spacing: normal;
28 |
29 | @include media-query-large {
30 | font-size: 3.5rem;
31 | }
32 | }
33 |
34 | p {
35 | font-size: 18px;
36 | font-family: $baseFontFamily;
37 | line-height: 27px;
38 | font-weight: 360;
39 | }
40 |
41 | a {
42 | color: $link-normal;
43 | border-color: $link-normal;
44 |
45 | &:hover {
46 | color: $link-hover;
47 | border-color: $link-hover;
48 | }
49 | }
50 | }
51 |
52 | -webkit-font-smoothing: antialiased;
53 | margin: 0;
54 | }
55 |
56 | @media print {
57 | body,
58 | article {
59 | width: 100%;
60 | margin: 0;
61 | padding: 0;
62 | }
63 |
64 | @page {
65 | margin: 2cm;
66 | }
67 |
68 | a:after {
69 | content: ' <' attr(href) '> ';
70 | font-size: 0.8em;
71 | font-weight: normal;
72 | }
73 |
74 | #radar-plot {
75 | display: none;
76 | }
77 |
78 | .quadrant-table {
79 | .quadrant-table__name {
80 | display: block;
81 | font-size: 36pt;
82 | padding: 0 10px;
83 | margin-bottom: 20px;
84 | }
85 |
86 | &.first .quadrant-table__name {
87 | color: $green;
88 | }
89 |
90 | &.second .quadrant-table__name {
91 | color: $blue;
92 | }
93 |
94 | &.third .quadrant-table__name {
95 | color: $orange;
96 | }
97 |
98 | &.fourth .quadrant-table__name {
99 | color: $violet;
100 | }
101 | }
102 |
103 | .quadrant-table {
104 | page-break-after: always;
105 |
106 | ul {
107 | list-style: none;
108 | padding: 0;
109 | margin: 0;
110 | }
111 |
112 | li {
113 | page-break-inside: avoid;
114 | }
115 |
116 | h3 {
117 | page-break-before: always;
118 | padding: 0 10px;
119 | text-transform: uppercase;
120 | font-size: 18pt;
121 | font-weight: bold;
122 | }
123 |
124 | h2 + h3 {
125 | page-break-before: avoid;
126 | }
127 | }
128 |
129 | .blip-list-item {
130 | font-weight: bold;
131 | }
132 |
133 | .blip-item-description {
134 | padding: 0 15px;
135 | }
136 |
137 | header {
138 | text-align: left;
139 |
140 | .radar-title .radar-title__text {
141 | font-size: 40px;
142 | width: 100%;
143 | padding: 10px;
144 | display: block;
145 | }
146 |
147 | .radar-title .radar-title__logo {
148 | display: block;
149 | width: auto;
150 |
151 | a {
152 | padding: 40px 10px 0;
153 | display: block;
154 |
155 | &::after {
156 | display: none;
157 | }
158 | }
159 |
160 | img {
161 | max-width: 150px;
162 | }
163 | }
164 |
165 | .buttons-group {
166 | display: none;
167 | }
168 |
169 | .home-link {
170 | display: none;
171 |
172 | &.selected {
173 | display: none;
174 | }
175 | }
176 |
177 | #alternative-buttons {
178 | display: none;
179 | }
180 |
181 | .print-radar {
182 | display: none;
183 | }
184 | }
185 |
186 | #footer {
187 | display: none;
188 | }
189 |
190 | .error-container {
191 | display: none;
192 | }
193 | }
194 |
195 | @media screen {
196 | #radar {
197 | width: 80%;
198 | margin: 0 auto;
199 | position: relative;
200 |
201 | svg#radar-plot {
202 | margin: 0 auto;
203 | transition: all 1s ease;
204 | position: absolute;
205 | left: 0;
206 | right: 0;
207 |
208 | .legend {
209 | visibility: hidden;
210 | transition: visibility 1s ease 1s;
211 | color: $black;
212 | }
213 |
214 | path {
215 | &.ring-arc-3 {
216 | stroke: none;
217 | fill: $grey-light;
218 | }
219 |
220 | &.ring-arc-2 {
221 | stroke: none;
222 | fill: $grey;
223 | }
224 |
225 | &.ring-arc-1 {
226 | stroke: none;
227 | fill: $grey-dark;
228 | }
229 |
230 | &.ring-arc-0 {
231 | stroke: none;
232 | fill: $grey-darkest;
233 | }
234 | }
235 |
236 | .blip-link {
237 | text-decoration: none;
238 | cursor: pointer;
239 | }
240 |
241 | .quadrant-group {
242 | cursor: pointer;
243 | }
244 |
245 | circle,
246 | polygon,
247 | path {
248 | &.first {
249 | fill: $green;
250 | stroke: none;
251 | }
252 |
253 | &.second {
254 | fill: $blue;
255 | stroke: none;
256 | }
257 |
258 | &.third {
259 | fill: $orange;
260 | stroke: none;
261 | }
262 |
263 | &.fourth {
264 | fill: $violet;
265 | stroke: none;
266 | }
267 | }
268 |
269 | line {
270 | stroke: white;
271 | }
272 |
273 | text {
274 | &.blip-text {
275 | font-size: 9px;
276 | font-style: italic;
277 | fill: $white;
278 | }
279 |
280 | &.line-text {
281 | font-weight: bold;
282 | text-transform: uppercase;
283 | fill: $black;
284 | font-size: 7px;
285 | }
286 | }
287 | }
288 |
289 | div.quadrant-table {
290 | .quadrant-table__name {
291 | display: none;
292 | }
293 |
294 | max-height: 0;
295 | max-width: 0;
296 | position: absolute;
297 | overflow: hidden;
298 |
299 | transition: max-height 0.5s ease 1s;
300 |
301 | h3 {
302 | text-transform: uppercase;
303 | font-size: $baseFont;
304 | margin: 0;
305 | font-weight: bold;
306 | }
307 |
308 | &.first {
309 | &.selected {
310 | float: right;
311 | }
312 | }
313 |
314 | &.second {
315 | &.selected {
316 | float: left;
317 | }
318 | }
319 |
320 | &.third {
321 | &.selected {
322 | float: left;
323 | }
324 | }
325 |
326 | &.fourth {
327 | &.selected {
328 | float: right;
329 | }
330 | }
331 |
332 | &.selected {
333 | position: relative;
334 | max-height: 10000px;
335 | max-width: 40%;
336 | }
337 |
338 | ul {
339 | padding: 0;
340 | margin-left: 0;
341 |
342 | li {
343 | list-style-type: none;
344 | padding-left: 0;
345 |
346 | .blip-list-item {
347 | padding: 2px 5px;
348 | border-radius: 2px;
349 | cursor: pointer;
350 | font-size: $baseFont;
351 | font-weight: 400;
352 |
353 | &.highlight {
354 | color: white;
355 | background-color: rgba(0, 0, 0, 0.8);
356 | }
357 | }
358 |
359 | .blip-item-description {
360 | max-height: 0;
361 | overflow: hidden;
362 | width: 300px;
363 |
364 | p {
365 | margin: 0;
366 | border-top: 1px solid rgb(119, 119, 119);
367 | border-bottom: 1px solid rgb(119, 119, 119);
368 | padding: 20px;
369 | color: $grey-text;
370 | font-weight: 100;
371 | font-size: 14px;
372 | }
373 |
374 | transition: max-height 0.2s ease;
375 |
376 | &.expanded {
377 | transition: max-height 0.5s ease 0.2s;
378 | max-height: 1000px;
379 | }
380 | }
381 | }
382 | }
383 | }
384 | }
385 | }
386 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://circleci.com/gh/thoughtworks/build-your-own-radar)
2 | [](https://github.com/thoughtworks/build-your-own-radar)
3 | [](https://david-dm.org/thoughtworks/build-your-own-radar)
4 | [](https://david-dm.org/thoughtworks/build-your-own-radar?type=dev)
5 | [](https://david-dm.org/thoughtworks/build-your-own-radar?type=peer)
6 | [](https://hub.docker.com/r/wwwthoughtworks/build-your-own-radar)
7 | [](https://github.com/thoughtworks/build-your-own-radar/graphs/contributors)
8 | [](https://github.com/sheerun/prettier-standard)
9 | [](https://github.com/thoughtworks/build-your-own-radar)
10 |
11 | A library that generates an interactive radar, inspired by [thoughtworks.com/radar](http://thoughtworks.com/radar).
12 |
13 | ## Demo
14 |
15 | You can see this in action at https://radar.thoughtworks.com. If you plug in [this data](https://docs.google.com/spreadsheets/d/1GBX3-jzlGkiKpYHF9RvVtu6GxSrco5OYTBv9YsOTXVg/edit#gid=0) you'll see [this visualization](https://radar.thoughtworks.com/?sheetId=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1GBX3-jzlGkiKpYHF9RvVtu6GxSrco5OYTBv9YsOTXVg%2Fedit%23gid%3D0).
16 |
17 | ## How To Use
18 |
19 | The easiest way to use the app out of the box is to provide a _public_ Google Sheet ID from which all the data will be fetched. You can enter that ID into the input field, sign in to Google using the prompt and your radar will be generated. The data must conform to the format below for the radar to be generated correctly.
20 |
21 | ### Setting up your data
22 |
23 | You need to make your data public in a form we can digest.
24 |
25 | Create a Google Sheet. Give it at least the below column headers, and put in the content that you want:
26 |
27 | | name | ring | quadrant | isNew | description |
28 | | ------------- | ------ | ---------------------- | ----- | ------------------------------------------------------- |
29 | | Composer | adopt | tools | TRUE | Although the idea of dependency management ... |
30 | | Canary builds | trial | techniques | FALSE | Many projects have external code dependencies ... |
31 | | Apache Kylin | assess | platforms | TRUE | Apache Kylin is an open source analytics solution ... |
32 | | JSF | hold | languages & frameworks | FALSE | We continue to see teams run into trouble using JSF ... |
33 |
34 | ### Sharing the sheet
35 |
36 | - In Google sheets, go to 'File', choose 'Publish to the web...' and then click 'Publish'.
37 | - Close the 'Publish to the web' dialog.
38 | - Copy the URL of your editable sheet from the browser (Don't worry, this does not share the editable version).
39 |
40 | The URL will be similar to [https://docs.google.com/spreadsheets/d/1waDG0_W3-yNiAaUfxcZhTKvl7AUCgXwQw8mdPjCz86U/edit](https://docs.google.com/spreadsheets/d/1waDG0_W3-yNiAaUfxcZhTKvl7AUCgXwQw8mdPjCz86U/edit). In theory we are only interested in the part between '/d/' and '/edit' but you can use the whole URL if you want.
41 |
42 | ### Using CSV data
43 |
44 | The other way to provide your data is using CSV document format.
45 | You can enter a publicly accessible URL (not behind any authentication) of a CSV file into the input field on the first page.
46 | For example, a [raw URL](https://raw.githubusercontent.com/thoughtworks/build-your-own-radar/master/spec/end_to_end_tests/resources/sheet.csv) for a CSV file hosted publicly on GitHub can be used.
47 | The format is just the same as that of the Google Sheet, the example is as follows:
48 |
49 | ```
50 | name,ring,quadrant,isNew,description
51 | Composer,adopt,tools,TRUE,"Although the idea of dependency management ..."
52 | Canary builds,trial,techniques,FALSE,"Many projects have external code dependencies ..."
53 | Apache Kylin,assess,platforms,TRUE,"Apache Kylin is an open source analytics solution ..."
54 | JSF,hold,languages & frameworks,FALSE,"We continue to see teams run into trouble using JSF ..."
55 | ```
56 |
57 | If you do not want to host the CSV file publicly, you can follow [these steps](#advanced-option---docker-image-with-a-csvjson-file-from-the-host-machine) to host the file locally on your BYOR docker instance itself.
58 |
59 | **_Note:_** The CSV file parsing is using D3 library, so consult the [D3 documentation](https://github.com/d3/d3-request/blob/master/README.md#csv) for the data format details.
60 |
61 | ### Using JSON data
62 |
63 | Another other way to provide your data is using a JSON array.
64 | You can enter a publicly accessible URL (not behind any authentication) of a JSON file into the input field on the first page.
65 | For example, a [raw URL](https://raw.githubusercontent.com/thoughtworks/build-your-own-radar/master/spec/end_to_end_tests/resources/data.json) for a JSON file hosted publicly on GitHub can be used.
66 | The format of the JSON is an array of objects with the the fields: `name`, `ring`, `quadrant`, `isNew`, and `description`.
67 |
68 | An example:
69 |
70 | ```json
71 | [
72 | {
73 | "name": "Composer",
74 | "ring": "adopt",
75 | "quadrant": "tools",
76 | "isNew": "TRUE",
77 | "description": "Although the idea of dependency management ..."
78 | },
79 | {
80 | "name": "Canary builds",
81 | "ring": "trial",
82 | "quadrant": "techniques",
83 | "isNew": "FALSE",
84 | "description": "Many projects have external code dependencies ..."
85 | },
86 | {
87 | "name": "Apache Kylin",
88 | "ring": "assess",
89 | "quadrant": "platforms",
90 | "isNew": "TRUE",
91 | "description": "Apache Kylin is an open source analytics solution ..."
92 | },
93 | {
94 | "name": "JSF",
95 | "ring": "hold",
96 | "quadrant": "languages & frameworks",
97 | "isNew": "FALSE",
98 | "description": "We continue to see teams run into trouble using JSF ..."
99 | }
100 | ]
101 | ```
102 |
103 | If you do not want to host the JSON file publicly, you can follow [these steps](#advanced-option---docker-image-with-a-csvjson-file-from-the-host-machine) to host the file locally on your BYOR docker instance itself.
104 |
105 | **_Note:_** The JSON file parsing is using D3 library, so consult the [D3 documentation](https://github.com/d3/d3-request/blob/master/README.md#json) for the data format details.
106 |
107 | ### Building the radar
108 |
109 | Paste the URL in the input field on the home page.
110 |
111 | That's it!
112 |
113 | **_Note:_** The quadrants of the radar, and the order of the rings inside the radar will be drawn in the order they appear in your data.
114 |
115 | Check [this page](https://www.thoughtworks.com/radar/how-to-byor) for step by step guidance.
116 |
117 | ### More complex usage
118 |
119 | To create the data representation, you can use the Google Sheet [factory](/src/util/factory.js) or CSV, or you can also insert all your data straight into the code.
120 |
121 | The app uses [Google Sheets APIs](https://developers.google.com/sheets/api/reference/rest) to fetch the data from a Google Sheet or [D3.js](https://d3js.org/) if supplied as CSV, so refer to their documentation for more advanced interaction. The input data is sanitized by whitelisting HTML tags with [sanitize-html](https://github.com/punkave/sanitize-html).
122 |
123 | The application uses [webpack](https://webpack.github.io/) to package dependencies and minify all .js and .scss files.
124 |
125 | By default, there is no distinction between both public and private Google Sheets as we now require authentication from Google (using OAuth Client ID and optionally, API Key), per Google's updated documentation. OAuth Client ID and API Key can be obtained from your Google developer console.
126 |
127 | ```
128 | export CLIENT_ID=[Google Client ID]
129 | ```
130 |
131 | Optionally, API Key can be set to bypass Google Authentication for public sheets.
132 |
133 | ```
134 | export API_KEY=[Google API Key]
135 | ```
136 |
137 | To enable Google Tag Manager, add the following environment variable.
138 |
139 | ```
140 | export GTM_ID=[GTM ID]
141 | ```
142 |
143 | ## Docker Image
144 |
145 | We have released BYOR as a docker image for our users. The image is available in our [DockerHub Repo](https://hub.docker.com/r/wwwthoughtworks/build-your-own-radar/). To pull and run the image, run the following commands.
146 |
147 | ```
148 | $ docker pull wwwthoughtworks/build-your-own-radar
149 | $ docker run --rm -p 8080:80 -e CLIENT_ID="[Google Client ID]" wwwthoughtworks/build-your-own-radar
150 | $ open http://localhost:8080
151 | ```
152 |
153 | ### Advanced option - Docker image with a CSV/JSON file from the host machine
154 |
155 | You can check your setup by clicking on "Build my radar" and by loading the `csv`/`json` file from these locations:
156 |
157 | - http://localhost:8080/files/radar.csv
158 | - http://localhost:8080/files/radar.json
159 |
160 | ```
161 | $ docker pull wwwthoughtworks/build-your-own-radar
162 | $ docker run --rm -p 8080:80 -e SERVER_NAMES="localhost 127.0.0.1" -v /mnt/radar/files/:/opt/build-your-own-radar/files wwwthoughtworks/build-your-own-radar
163 | $ open http://localhost:8080
164 | ```
165 |
166 | This will:
167 |
168 | - Spawn a server that will listen locally on port 8080.
169 | - Mount the host volume on `/mnt/radar/files/` into the container on `/opt/build-your-own-radar/files/`.
170 | - Open http://localhost:8080 and for the URL enter: http://localhost:8080/files/${NAME_OF_YOUR_FILE}.${EXTENSION_OF_YOUR_FILE[csv/json]}. It needs to be a csv/json file.
171 |
172 | You can now work locally on your machine, updating the csv/json file and render the result back on your browser.
173 | There is a sample csv and json file placed in `spec/end_to_end_tests/resources/localfiles/` for reference.
174 |
175 | **_Note:_**
176 |
177 | - If API Key is also available, same can be provided to the `docker run` command as `-e API_KEY=[Google API Key]`.
178 | - For setting the `publicPath` in the webpack config while using this image, the path can be passed as an environment variable called `ASSET_PATH`.
179 |
180 | ## Contribute
181 |
182 | All tasks are defined in `package.json`.
183 |
184 | Pull requests are welcome; please write tests whenever possible.
185 | Make sure you have nodejs installed.
186 |
187 | - `git clone git@github.com:thoughtworks/build-your-own-radar.git`
188 | - `npm install`
189 | - `npm run quality` - to run your tests
190 | - `npm run dev` - to run application in localhost:8080. This will watch the .js and .css files and rebuild on file changes
191 |
192 | ## End to End Tests
193 |
194 | To run End to End tests in headless mode
195 |
196 | - add a new environment variable 'TEST_URL' and set it to 'http://localhost:8080/'
197 | - add a new environment variable 'TEST_ENV' and set it to 'development' or 'production'
198 | - `npm run test:e2e`
199 |
200 | To run End to End tests in debug mode
201 |
202 | - add a new environment variable 'TEST_URL' and set it to 'http://localhost:8080/'
203 | - add a new environment variable 'TEST_ENV' and set it to 'development' or 'production'
204 | - `npm run start`
205 | - Click on 'Run all specs' in cypress window
206 |
207 | **_Note:_** Currently, end to end tests are not working, as the flow requires Google login via prompt, which Cypress does not support. We are working to find some alternative solution for this.
208 |
209 | ### Don't want to install node? Run with one line docker
210 |
211 | $ docker run -p 8080:8080 -v $PWD:/app -w /app -it node:10.15.3 /bin/sh -c 'npm install && npm run dev'
212 |
213 | **_Note:_** If you are facing Node-sass compile error while running, please prefix the command `npm rebuild node-sass` before `npm run dev`. like this
214 |
215 | ```
216 | npm install && npm rebuild node-sass && npm run dev
217 | ```
218 |
219 | After building it will start on `localhost:8080`
220 |
--------------------------------------------------------------------------------
/src/util/factory.js:
--------------------------------------------------------------------------------
1 | /* eslint no-constant-condition: "off" */
2 |
3 | const d3 = require('d3')
4 | const _ = {
5 | map: require('lodash/map'),
6 | uniqBy: require('lodash/uniqBy'),
7 | capitalize: require('lodash/capitalize'),
8 | each: require('lodash/each'),
9 | }
10 |
11 | const InputSanitizer = require('./inputSanitizer')
12 | const Radar = require('../models/radar')
13 | const Quadrant = require('../models/quadrant')
14 | const Ring = require('../models/ring')
15 | const Blip = require('../models/blip')
16 | const GraphingRadar = require('../graphing/radar')
17 | const QueryParams = require('./queryParamProcessor')
18 | const MalformedDataError = require('../exceptions/malformedDataError')
19 | const SheetNotFoundError = require('../exceptions/sheetNotFoundError')
20 | const ContentValidator = require('./contentValidator')
21 | const Sheet = require('./sheet')
22 | const ExceptionMessages = require('./exceptionMessages')
23 | const GoogleAuth = require('./googleAuth')
24 | const config = require('../config')
25 | const googleAuth = require('./googleAuth')
26 |
27 | const plotRadar = function (title, blips, currentRadarName, alternativeRadars) {
28 | if (title.endsWith('.csv')) {
29 | title = title.substring(0, title.length - 4)
30 | }
31 | if (title.endsWith('.json')) {
32 | title = title.substring(0, title.length - 5)
33 | }
34 | document.title = title
35 | d3.selectAll('.loading').remove()
36 |
37 | var rings = _.map(_.uniqBy(blips, 'ring'), 'ring')
38 | var ringMap = {}
39 | var maxRings = 4
40 |
41 | _.each(rings, function (ringName, i) {
42 | if (i === maxRings) {
43 | throw new MalformedDataError(ExceptionMessages.TOO_MANY_RINGS)
44 | }
45 | ringMap[ringName] = new Ring(ringName, i)
46 | })
47 |
48 | var quadrants = {}
49 | _.each(blips, function (blip) {
50 | if (!quadrants[blip.quadrant]) {
51 | quadrants[blip.quadrant] = new Quadrant(_.capitalize(blip.quadrant))
52 | }
53 | quadrants[blip.quadrant].add(
54 | new Blip(blip.name, ringMap[blip.ring], blip.isNew.toLowerCase() === 'true', blip.topic, blip.description),
55 | )
56 | })
57 |
58 | var radar = new Radar()
59 | _.each(quadrants, function (quadrant) {
60 | radar.addQuadrant(quadrant)
61 | })
62 |
63 | if (alternativeRadars !== undefined || true) {
64 | alternativeRadars.forEach(function (sheetName) {
65 | radar.addAlternative(sheetName)
66 | })
67 | }
68 |
69 | if (currentRadarName !== undefined || true) {
70 | radar.setCurrentSheet(currentRadarName)
71 | }
72 |
73 | var size = window.innerHeight - 133 < 620 ? 620 : window.innerHeight - 133
74 |
75 | new GraphingRadar(size, radar).init().plot()
76 | }
77 |
78 | const GoogleSheet = function (sheetReference, sheetName) {
79 | var self = {}
80 |
81 | self.build = function () {
82 | var sheet = new Sheet(sheetReference)
83 | sheet.validate(function (error, apiKeyEnabled) {
84 | if (error instanceof SheetNotFoundError) {
85 | plotErrorMessage(error, 'sheet')
86 | return
87 | }
88 |
89 | self.authenticate(false, apiKeyEnabled)
90 | })
91 | }
92 |
93 | function createBlipsForProtectedSheet(documentTitle, values, sheetNames) {
94 | if (!sheetName) {
95 | sheetName = sheetNames[0]
96 | }
97 | values.forEach(function () {
98 | var contentValidator = new ContentValidator(values[0])
99 | contentValidator.verifyContent()
100 | contentValidator.verifyHeaders()
101 | })
102 |
103 | const all = values
104 | const header = all.shift()
105 | var blips = _.map(all, (blip) => new InputSanitizer().sanitizeForProtectedSheet(blip, header))
106 | plotRadar(documentTitle + ' - ' + sheetName, blips, sheetName, sheetNames)
107 | }
108 |
109 | self.authenticate = function (force = false, apiKeyEnabled, callback) {
110 | GoogleAuth.loadGoogle(force, function () {
111 | const sheet = new Sheet(sheetReference)
112 | sheet.isPublicSheet().then((isPublic) => {
113 | if (!isPublic && !googleAuth.gsiInitiated) {
114 | GoogleAuth.loadGSI()
115 | } else {
116 | sheet.processSheetResponse(sheetName, createBlipsForProtectedSheet, (error) => {
117 | if (error.status === 403) {
118 | plotUnauthorizedErrorMessage()
119 | } else {
120 | plotErrorMessage(error, 'sheet')
121 | }
122 | })
123 | }
124 | })
125 | if (callback) {
126 | callback()
127 | }
128 | })
129 | }
130 |
131 | self.init = function () {
132 | plotLoading()
133 | return self
134 | }
135 |
136 | return self
137 | }
138 |
139 | const CSVDocument = function (url) {
140 | var self = {}
141 |
142 | self.build = function () {
143 | d3.csv(url)
144 | .then(createBlips)
145 | .catch((exception) => {
146 | plotErrorMessage(exception, 'csv')
147 | })
148 | }
149 |
150 | var createBlips = function (data) {
151 | try {
152 | var columnNames = data.columns
153 | delete data.columns
154 | var contentValidator = new ContentValidator(columnNames)
155 | contentValidator.verifyContent()
156 | contentValidator.verifyHeaders()
157 | var blips = _.map(data, new InputSanitizer().sanitize)
158 | plotRadar(FileName(url), blips, 'CSV File', [])
159 | } catch (exception) {
160 | plotErrorMessage(exception, 'csv')
161 | }
162 | }
163 |
164 | self.init = function () {
165 | plotLoading()
166 | return self
167 | }
168 |
169 | return self
170 | }
171 |
172 | const JSONFile = function (url) {
173 | var self = {}
174 |
175 | self.build = function () {
176 | d3.json(url)
177 | .then(createBlips)
178 | .catch((exception) => {
179 | plotErrorMessage(exception, 'json')
180 | })
181 | }
182 |
183 | var createBlips = function (data) {
184 | try {
185 | var columnNames = Object.keys(data[0])
186 | var contentValidator = new ContentValidator(columnNames)
187 | contentValidator.verifyContent()
188 | contentValidator.verifyHeaders()
189 | var blips = _.map(data, new InputSanitizer().sanitize)
190 | plotRadar(FileName(url), blips, 'JSON File', [])
191 | } catch (exception) {
192 | plotErrorMessage(exception, 'json')
193 | }
194 | }
195 |
196 | self.init = function () {
197 | plotLoading()
198 | return self
199 | }
200 |
201 | return self
202 | }
203 |
204 | const DomainName = function (url) {
205 | var search = /.+:\/\/([^\\/]+)/
206 | var match = search.exec(decodeURIComponent(url.replace(/\+/g, ' ')))
207 | return match == null ? null : match[1]
208 | }
209 |
210 | const FileName = function (url) {
211 | var search = /([^\\/]+)$/
212 | var match = search.exec(decodeURIComponent(url.replace(/\+/g, ' ')))
213 | if (match != null) {
214 | var str = match[1]
215 | return str
216 | }
217 | return url
218 | }
219 |
220 | const GoogleSheetInput = function () {
221 | var self = {}
222 | var sheet
223 |
224 | self.build = function () {
225 | var domainName = DomainName(window.location.search.substring(1))
226 | var queryString = window.location.href.match(/sheetId(.*)/)
227 | var queryParams = queryString ? QueryParams(queryString[0]) : {}
228 |
229 | if (queryParams.sheetId && queryParams.sheetId.endsWith('.csv')) {
230 | sheet = CSVDocument(queryParams.sheetId)
231 | sheet.init().build()
232 | } else if (queryParams.sheetId && queryParams.sheetId.endsWith('.json')) {
233 | sheet = JSONFile(queryParams.sheetId)
234 | sheet.init().build()
235 | } else if (domainName && domainName.endsWith('google.com') && queryParams.sheetId) {
236 | sheet = GoogleSheet(queryParams.sheetId, queryParams.sheetName)
237 |
238 | sheet.init().build()
239 | } else {
240 | if (!config.featureToggles.UIRefresh2022) {
241 | document.body.style.opacity = '1'
242 | document.body.innerHTML = ''
243 | const content = d3.select('body').append('div').attr('class', 'input-sheet')
244 | plotLogo(content)
245 | const bannerText =
246 | '
Build your own radar
Once you\'ve created your Radar, you can use this service' +
247 | ' to generate an interactive version of your Technology Radar. Not sure how? Read this first.
Your Technology Radar will be available in just a few seconds
'
279 | plotBanner(content, bannerText)
280 | plotFooter(content)
281 | } else {
282 | document.querySelector('.helper-description > p').style.display = 'none'
283 | document.querySelector('.input-sheet-form').style.display = 'none'
284 | document.querySelector('.helper-description .loader-text').style.display = 'block'
285 | }
286 | }
287 |
288 | function plotLogo(content) {
289 | content
290 | .append('div')
291 | .attr('class', 'input-sheet__logo')
292 | .html('')
293 | }
294 |
295 | function plotFooter(content) {
296 | content
297 | .append('div')
298 | .attr('id', 'footer')
299 | .append('div')
300 | .attr('class', 'footer-content')
301 | .append('p')
302 | .html(
303 | 'Powered by Thoughtworks. ' +
304 | 'By using this service you agree to Thoughtworks\' terms of use. ' +
305 | 'You also agree to our privacy policy, which describes how we will gather, use and protect any personal data contained in your public Google Sheet. ' +
306 | 'This software is open source and available for download and self-hosting.',
307 | )
308 | }
309 |
310 | function plotBanner(content, text) {
311 | content.append('div').attr('class', 'input-sheet__banner').html(text)
312 | }
313 |
314 | function plotForm(content) {
315 | content
316 | .append('div')
317 | .attr('class', 'input-sheet__form')
318 | .append('p')
319 | .html(
320 | 'Enter the URL of your Google Sheet, CSV or JSON file below…',
321 | )
322 |
323 | var form = content.select('.input-sheet__form').append('form').attr('method', 'get')
324 |
325 | form
326 | .append('input')
327 | .attr('type', 'text')
328 | .attr('name', 'sheetId')
329 | .attr('placeholder', 'e.g. https://docs.google.com/spreadsheets/d/ or hosted CSV/JSON file')
330 | .attr('required', '')
331 |
332 | form.append('button').attr('type', 'submit').append('a').attr('class', 'button').text('Build my radar')
333 |
334 | form.append('p').html("Need help?")
335 | }
336 |
337 | function plotErrorMessage(exception, fileType) {
338 | if (config.featureToggles.UIRefresh2022) {
339 | showErrorMessage(exception, fileType)
340 | } else {
341 | const content = d3.select('body').append('div').attr('class', 'input-sheet')
342 | setDocumentTitle()
343 |
344 | plotLogo(content)
345 |
346 | const bannerText =
347 | '
Build your own radar
Once you\'ve created your Radar, you can use this service' +
348 | ' to generate an interactive version of your Technology Radar. Not sure how? Read this first.
'
404 |
405 | plotBanner(content, bannerText)
406 |
407 | d3.selectAll('.loading').remove()
408 | } else {
409 | content = d3.select('main')
410 | helperDescription.style('display', 'none')
411 | }
412 | const currentUser = GoogleAuth.getEmail()
413 | let homePageURL = window.location.protocol + '//' + window.location.hostname
414 | homePageURL += window.location.port === '' ? '' : ':' + window.location.port
415 | const goBack = 'GO BACK'
416 | const message = `Oops! Looks like you are accessing this sheet using ${currentUser}, which does not have permission.Try switching to another account.`
417 |
418 | const container = content.append('div').attr('class', 'error-container')
419 |
420 | const errorContainer = container.append('div').attr('class', 'error-container__message')
421 |
422 | errorContainer.append('div').append('p').attr('class', 'error-title').html(message)
423 |
424 | const button = errorContainer.append('button').attr('class', 'button switch-account-button').text('SWITCH ACCOUNT')
425 |
426 | errorContainer
427 | .append('div')
428 | .append('p')
429 | .attr('class', 'error-subtitle')
430 | .html(`or ${goBack} to try a different sheet.`)
431 |
432 | button.on('click', () => {
433 | var queryString = window.location.href.match(/sheetId(.*)/)
434 | var queryParams = queryString ? QueryParams(queryString[0]) : {}
435 | const sheet = GoogleSheet(queryParams.sheetId, queryParams.sheetName)
436 | sheet.authenticate(true, false, () => {
437 | if (config.featureToggles.UIRefresh2022) {
438 | helperDescription.style('display', 'block')
439 | errorContainer.remove()
440 | } else {
441 | content.remove()
442 | }
443 | })
444 | })
445 | }
446 |
447 | module.exports = GoogleSheetInput
448 |
--------------------------------------------------------------------------------
/src/graphing/radar.js:
--------------------------------------------------------------------------------
1 | const d3 = require('d3')
2 | const { default: d3tip } = require('d3-tip')
3 | const Chance = require('chance')
4 | const _ = require('lodash/core')
5 |
6 | const RingCalculator = require('../util/ringCalculator')
7 | const QueryParams = require('../util/queryParamProcessor')
8 | const AutoComplete = require('../util/autoComplete')
9 | const config = require('../config')
10 |
11 | const MIN_BLIP_WIDTH = 12
12 | const ANIMATION_DURATION = 1000
13 |
14 | const Radar = function (size, radar) {
15 | var svg, radarElement, quadrantButtons, buttonsGroup, header, alternativeDiv
16 |
17 | var tip = d3tip()
18 | .attr('class', 'd3-tip')
19 | .html(function (text) {
20 | return text
21 | })
22 |
23 | tip.direction(function () {
24 | if (d3.select('.quadrant-table.selected').node()) {
25 | var selectedQuadrant = d3.select('.quadrant-table.selected')
26 | if (selectedQuadrant.classed('first') || selectedQuadrant.classed('fourth')) {
27 | return 'ne'
28 | } else {
29 | return 'nw'
30 | }
31 | }
32 | return 'n'
33 | })
34 |
35 | var ringCalculator = new RingCalculator(radar.rings().length, center())
36 |
37 | var self = {}
38 | var chance
39 |
40 | function center() {
41 | return Math.round(size / 2)
42 | }
43 |
44 | function toRadian(angleInDegrees) {
45 | return (Math.PI * angleInDegrees) / 180
46 | }
47 |
48 | function plotLines(quadrantGroup, quadrant) {
49 | var startX = size * (1 - (-Math.sin(toRadian(quadrant.startAngle)) + 1) / 2)
50 | var endX = size * (1 - (-Math.sin(toRadian(quadrant.startAngle - 90)) + 1) / 2)
51 |
52 | var startY = size * (1 - (Math.cos(toRadian(quadrant.startAngle)) + 1) / 2)
53 | var endY = size * (1 - (Math.cos(toRadian(quadrant.startAngle - 90)) + 1) / 2)
54 |
55 | if (startY > endY) {
56 | var aux = endY
57 | endY = startY
58 | startY = aux
59 | }
60 |
61 | quadrantGroup
62 | .append('line')
63 | .attr('x1', center())
64 | .attr('x2', center())
65 | .attr('y1', startY - 2)
66 | .attr('y2', endY + 2)
67 | .attr('stroke-width', 10)
68 |
69 | quadrantGroup
70 | .append('line')
71 | .attr('x1', endX)
72 | .attr('y1', center())
73 | .attr('x2', startX)
74 | .attr('y2', center())
75 | .attr('stroke-width', 10)
76 | }
77 |
78 | function plotQuadrant(rings, quadrant) {
79 | var quadrantGroup = svg
80 | .append('g')
81 | .attr('class', 'quadrant-group quadrant-group-' + quadrant.order)
82 | .on('mouseover', mouseoverQuadrant.bind({}, quadrant.order))
83 | .on('mouseout', mouseoutQuadrant.bind({}, quadrant.order))
84 | .on('click', selectQuadrant.bind({}, quadrant.order, quadrant.startAngle))
85 |
86 | rings.forEach(function (ring, i) {
87 | var arc = d3
88 | .arc()
89 | .innerRadius(ringCalculator.getRadius(i))
90 | .outerRadius(ringCalculator.getRadius(i + 1))
91 | .startAngle(toRadian(quadrant.startAngle))
92 | .endAngle(toRadian(quadrant.startAngle - 90))
93 |
94 | quadrantGroup
95 | .append('path')
96 | .attr('d', arc)
97 | .attr('class', 'ring-arc-' + ring.order())
98 | .attr('transform', 'translate(' + center() + ', ' + center() + ')')
99 | })
100 |
101 | return quadrantGroup
102 | }
103 |
104 | function plotTexts(quadrantGroup, rings, quadrant) {
105 | rings.forEach(function (ring, i) {
106 | if (quadrant.order === 'first' || quadrant.order === 'fourth') {
107 | quadrantGroup
108 | .append('text')
109 | .attr('class', 'line-text')
110 | .attr('y', center() + 4)
111 | .attr('x', center() + (ringCalculator.getRadius(i) + ringCalculator.getRadius(i + 1)) / 2)
112 | .attr('text-anchor', 'middle')
113 | .text(ring.name())
114 | } else {
115 | quadrantGroup
116 | .append('text')
117 | .attr('class', 'line-text')
118 | .attr('y', center() + 4)
119 | .attr('x', center() - (ringCalculator.getRadius(i) + ringCalculator.getRadius(i + 1)) / 2)
120 | .attr('text-anchor', 'middle')
121 | .text(ring.name())
122 | }
123 | })
124 | }
125 |
126 | function triangle(blip, x, y, order, group) {
127 | return group
128 | .append('path')
129 | .attr(
130 | 'd',
131 | 'M412.201,311.406c0.021,0,0.042,0,0.063,0c0.067,0,0.135,0,0.201,0c4.052,0,6.106-0.051,8.168-0.102c2.053-0.051,4.115-0.102,8.176-0.102h0.103c6.976-0.183,10.227-5.306,6.306-11.53c-3.988-6.121-4.97-5.407-8.598-11.224c-1.631-3.008-3.872-4.577-6.179-4.577c-2.276,0-4.613,1.528-6.48,4.699c-3.578,6.077-3.26,6.014-7.306,11.723C402.598,306.067,405.426,311.406,412.201,311.406',
132 | )
133 | .attr(
134 | 'transform',
135 | 'scale(' +
136 | blip.width / 34 +
137 | ') translate(' +
138 | (-404 + x * (34 / blip.width) - 17) +
139 | ', ' +
140 | (-282 + y * (34 / blip.width) - 17) +
141 | ')',
142 | )
143 | .attr('class', order)
144 | }
145 |
146 | function triangleLegend(x, y, group) {
147 | return group
148 | .append('path')
149 | .attr(
150 | 'd',
151 | 'M412.201,311.406c0.021,0,0.042,0,0.063,0c0.067,0,0.135,0,0.201,0c4.052,0,6.106-0.051,8.168-0.102c2.053-0.051,4.115-0.102,8.176-0.102h0.103c6.976-0.183,10.227-5.306,6.306-11.53c-3.988-6.121-4.97-5.407-8.598-11.224c-1.631-3.008-3.872-4.577-6.179-4.577c-2.276,0-4.613,1.528-6.48,4.699c-3.578,6.077-3.26,6.014-7.306,11.723C402.598,306.067,405.426,311.406,412.201,311.406',
152 | )
153 | .attr(
154 | 'transform',
155 | 'scale(' + 22 / 64 + ') translate(' + (-404 + x * (64 / 22) - 17) + ', ' + (-282 + y * (64 / 22) - 17) + ')',
156 | )
157 | }
158 |
159 | function circle(blip, x, y, order, group) {
160 | return (group || svg)
161 | .append('path')
162 | .attr(
163 | 'd',
164 | 'M420.084,282.092c-1.073,0-2.16,0.103-3.243,0.313c-6.912,1.345-13.188,8.587-11.423,16.874c1.732,8.141,8.632,13.711,17.806,13.711c0.025,0,0.052,0,0.074-0.003c0.551-0.025,1.395-0.011,2.225-0.109c4.404-0.534,8.148-2.218,10.069-6.487c1.747-3.886,2.114-7.993,0.913-12.118C434.379,286.944,427.494,282.092,420.084,282.092',
165 | )
166 | .attr(
167 | 'transform',
168 | 'scale(' +
169 | blip.width / 34 +
170 | ') translate(' +
171 | (-404 + x * (34 / blip.width) - 17) +
172 | ', ' +
173 | (-282 + y * (34 / blip.width) - 17) +
174 | ')',
175 | )
176 | .attr('class', order)
177 | }
178 |
179 | function circleLegend(x, y, group) {
180 | return (group || svg)
181 | .append('path')
182 | .attr(
183 | 'd',
184 | 'M420.084,282.092c-1.073,0-2.16,0.103-3.243,0.313c-6.912,1.345-13.188,8.587-11.423,16.874c1.732,8.141,8.632,13.711,17.806,13.711c0.025,0,0.052,0,0.074-0.003c0.551-0.025,1.395-0.011,2.225-0.109c4.404-0.534,8.148-2.218,10.069-6.487c1.747-3.886,2.114-7.993,0.913-12.118C434.379,286.944,427.494,282.092,420.084,282.092',
185 | )
186 | .attr(
187 | 'transform',
188 | 'scale(' + 22 / 64 + ') translate(' + (-404 + x * (64 / 22) - 17) + ', ' + (-282 + y * (64 / 22) - 17) + ')',
189 | )
190 | }
191 |
192 | function addRing(ring, order) {
193 | var table = d3.select('.quadrant-table.' + order)
194 | table.append('h3').text(ring)
195 | return table.append('ul')
196 | }
197 |
198 | function calculateBlipCoordinates(blip, chance, minRadius, maxRadius, startAngle) {
199 | var adjustX = Math.sin(toRadian(startAngle)) - Math.cos(toRadian(startAngle))
200 | var adjustY = -Math.cos(toRadian(startAngle)) - Math.sin(toRadian(startAngle))
201 |
202 | var radius = chance.floating({
203 | min: minRadius + blip.width / 2,
204 | max: maxRadius - blip.width / 2,
205 | })
206 | var angleDelta = (Math.asin(blip.width / 2 / radius) * 180) / (Math.PI - 1.25)
207 | angleDelta = angleDelta > 45 ? 45 : angleDelta
208 | var angle = toRadian(chance.integer({ min: angleDelta, max: 90 - angleDelta }))
209 |
210 | var x = center() + radius * Math.cos(angle) * adjustX
211 | var y = center() + radius * Math.sin(angle) * adjustY
212 |
213 | return [x, y]
214 | }
215 |
216 | function thereIsCollision(blip, coordinates, allCoordinates) {
217 | return allCoordinates.some(function (currentCoordinates) {
218 | return (
219 | Math.abs(currentCoordinates[0] - coordinates[0]) < blip.width &&
220 | Math.abs(currentCoordinates[1] - coordinates[1]) < blip.width
221 | )
222 | })
223 | }
224 |
225 | function plotBlips(quadrantGroup, rings, quadrantWrapper) {
226 | var blips, quadrant, startAngle, order
227 |
228 | quadrant = quadrantWrapper.quadrant
229 | startAngle = quadrantWrapper.startAngle
230 | order = quadrantWrapper.order
231 |
232 | d3.select('.quadrant-table.' + order)
233 | .append('h2')
234 | .attr('class', 'quadrant-table__name')
235 | .text(quadrant.name())
236 |
237 | blips = quadrant.blips()
238 | rings.forEach(function (ring, i) {
239 | var ringBlips = blips.filter(function (blip) {
240 | return blip.ring() === ring
241 | })
242 |
243 | if (ringBlips.length === 0) {
244 | return
245 | }
246 |
247 | var maxRadius, minRadius
248 |
249 | minRadius = ringCalculator.getRadius(i)
250 | maxRadius = ringCalculator.getRadius(i + 1)
251 |
252 | var sumRing = ring
253 | .name()
254 | .split('')
255 | .reduce(function (p, c) {
256 | return p + c.charCodeAt(0)
257 | }, 0)
258 | var sumQuadrant = quadrant
259 | .name()
260 | .split('')
261 | .reduce(function (p, c) {
262 | return p + c.charCodeAt(0)
263 | }, 0)
264 | chance = new Chance(Math.PI * sumRing * ring.name().length * sumQuadrant * quadrant.name().length)
265 |
266 | var ringList = addRing(ring.name(), order)
267 | var allBlipCoordinatesInRing = []
268 |
269 | ringBlips.forEach(function (blip) {
270 | const coordinates = findBlipCoordinates(blip, minRadius, maxRadius, startAngle, allBlipCoordinatesInRing)
271 |
272 | allBlipCoordinatesInRing.push(coordinates)
273 | drawBlipInCoordinates(blip, coordinates, order, quadrantGroup, ringList)
274 | })
275 | })
276 | }
277 |
278 | function findBlipCoordinates(blip, minRadius, maxRadius, startAngle, allBlipCoordinatesInRing) {
279 | const maxIterations = 200
280 | var coordinates = calculateBlipCoordinates(blip, chance, minRadius, maxRadius, startAngle)
281 | var iterationCounter = 0
282 | var foundAPlace = false
283 |
284 | while (iterationCounter < maxIterations) {
285 | if (thereIsCollision(blip, coordinates, allBlipCoordinatesInRing)) {
286 | coordinates = calculateBlipCoordinates(blip, chance, minRadius, maxRadius, startAngle)
287 | } else {
288 | foundAPlace = true
289 | break
290 | }
291 | iterationCounter++
292 | }
293 |
294 | if (!foundAPlace && blip.width > MIN_BLIP_WIDTH) {
295 | blip.width = blip.width - 1
296 | return findBlipCoordinates(blip, minRadius, maxRadius, startAngle, allBlipCoordinatesInRing)
297 | } else {
298 | return coordinates
299 | }
300 | }
301 |
302 | function drawBlipInCoordinates(blip, coordinates, order, quadrantGroup, ringList) {
303 | var x = coordinates[0]
304 | var y = coordinates[1]
305 |
306 | var group = quadrantGroup
307 | .append('g')
308 | .attr('class', 'blip-link')
309 | .attr('id', 'blip-link-' + blip.number())
310 |
311 | if (blip.isNew()) {
312 | triangle(blip, x, y, order, group)
313 | } else {
314 | circle(blip, x, y, order, group)
315 | }
316 |
317 | group
318 | .append('text')
319 | .attr('x', x)
320 | .attr('y', y + 4)
321 | .attr('class', 'blip-text')
322 | // derive font-size from current blip width
323 | .style('font-size', (blip.width * 10) / 22 + 'px')
324 | .attr('text-anchor', 'middle')
325 | .text(blip.number())
326 |
327 | var blipListItem = ringList.append('li')
328 | var blipText = blip.number() + '. ' + blip.name() + (blip.topic() ? '. - ' + blip.topic() : '')
329 | blipListItem
330 | .append('div')
331 | .attr('class', 'blip-list-item')
332 | .attr('id', 'blip-list-item-' + blip.number())
333 | .text(blipText)
334 |
335 | var blipItemDescription = blipListItem
336 | .append('div')
337 | .attr('id', 'blip-description-' + blip.number())
338 | .attr('class', 'blip-item-description')
339 | if (blip.description()) {
340 | blipItemDescription.append('p').html(blip.description())
341 | }
342 |
343 | var mouseOver = function () {
344 | d3.selectAll('g.blip-link').attr('opacity', 0.3)
345 | group.attr('opacity', 1.0)
346 | blipListItem.selectAll('.blip-list-item').classed('highlight', true)
347 | tip.show(blip.name(), group.node())
348 | }
349 |
350 | var mouseOut = function () {
351 | d3.selectAll('g.blip-link').attr('opacity', 1.0)
352 | blipListItem.selectAll('.blip-list-item').classed('highlight', false)
353 | tip.hide().style('left', 0).style('top', 0)
354 | }
355 |
356 | blipListItem.on('mouseover', mouseOver).on('mouseout', mouseOut)
357 | group.on('mouseover', mouseOver).on('mouseout', mouseOut)
358 |
359 | var clickBlip = function () {
360 | d3.select('.blip-item-description.expanded').node() !== blipItemDescription.node() &&
361 | d3.select('.blip-item-description.expanded').classed('expanded', false)
362 | blipItemDescription.classed('expanded', !blipItemDescription.classed('expanded'))
363 |
364 | blipItemDescription.on('click', function () {
365 | d3.event.stopPropagation()
366 | })
367 | }
368 |
369 | blipListItem.on('click', clickBlip)
370 | }
371 |
372 | function removeHomeLink() {
373 | d3.select('.home-link').remove()
374 | }
375 |
376 | function createHomeLink(pageElement) {
377 | if (pageElement.select('.home-link').empty()) {
378 | pageElement
379 | .insert('div', 'div#alternative-buttons')
380 | .html('« Back to Radar home')
381 | .classed('home-link', true)
382 | .classed('selected', true)
383 | .on('click', redrawFullRadar)
384 | .append('g')
385 | .attr('fill', '#626F87')
386 | .append('path')
387 | .attr(
388 | 'd',
389 | 'M27.6904224,13.939279 C27.6904224,13.7179572 27.6039633,13.5456925 27.4314224,13.4230122 L18.9285959,6.85547454 C18.6819796,6.65886965 18.410898,6.65886965 18.115049,6.85547454 L9.90776939,13.4230122 C9.75999592,13.5456925 9.68592041,13.7179572 9.68592041,13.939279 L9.68592041,25.7825947 C9.68592041,25.979501 9.74761224,26.1391059 9.87092041,26.2620876 C9.99415306,26.3851446 10.1419265,26.4467108 10.3145429,26.4467108 L15.1946918,26.4467108 C15.391698,26.4467108 15.5518551,26.3851446 15.6751633,26.2620876 C15.7984714,26.1391059 15.8600878,25.979501 15.8600878,25.7825947 L15.8600878,18.5142424 L21.4794061,18.5142424 L21.4794061,25.7822933 C21.4794061,25.9792749 21.5410224,26.1391059 21.6643306,26.2620876 C21.7876388,26.3851446 21.9477959,26.4467108 22.1448776,26.4467108 L27.024951,26.4467108 C27.2220327,26.4467108 27.3821898,26.3851446 27.505498,26.2620876 C27.6288061,26.1391059 27.6904224,25.9792749 27.6904224,25.7822933 L27.6904224,13.939279 Z M18.4849735,0.0301425662 C21.0234,0.0301425662 23.4202449,0.515814664 25.6755082,1.48753564 C27.9308469,2.45887984 29.8899592,3.77497963 31.5538265,5.43523218 C33.2173918,7.09540937 34.5358755,9.05083299 35.5095796,11.3015031 C36.4829061,13.5518717 36.9699469,15.9439104 36.9699469,18.4774684 C36.9699469,20.1744196 36.748098,21.8101813 36.3044755,23.3844521 C35.860551,24.9584216 35.238498,26.4281731 34.4373347,27.7934053 C33.6362469,29.158336 32.6753041,30.4005112 31.5538265,31.5197047 C30.432349,32.6388982 29.1876388,33.5981853 27.8199224,34.3973401 C26.4519041,35.1968717 24.9791531,35.8176578 23.4016694,36.2606782 C21.8244878,36.7033971 20.1853878,36.9247943 18.4849735,36.9247943 C16.7841816,36.9247943 15.1453837,36.7033971 13.5679755,36.2606782 C11.9904918,35.8176578 10.5180429,35.1968717 9.15002449,34.3973401 C7.78223265,33.5978839 6.53752245,32.6388982 5.41612041,31.5197047 C4.29464286,30.4005112 3.33339796,29.158336 2.53253673,27.7934053 C1.73144898,26.4281731 1.10909388,24.9584216 0.665395918,23.3844521 C0.22184898,21.8101813 0,20.1744196 0,18.4774684 C0,16.7801405 0.22184898,15.1446802 0.665395918,13.5704847 C1.10909388,11.9962138 1.73144898,10.5267637 2.53253673,9.16153157 C3.33339796,7.79652546 4.29464286,6.55435031 5.41612041,5.43523218 C6.53752245,4.3160387 7.78223265,3.35675153 9.15002449,2.55752138 C10.5180429,1.75806517 11.9904918,1.13690224 13.5679755,0.694183299 C15.1453837,0.251464358 16.7841816,0.0301425662 18.4849735,0.0301425662 L18.4849735,0.0301425662 Z',
390 | )
391 | }
392 | }
393 |
394 | function removeRadarLegend() {
395 | d3.select('.legend').remove()
396 | }
397 |
398 | function drawLegend(order) {
399 | removeRadarLegend()
400 |
401 | var triangleKey = 'New or moved'
402 | var circleKey = 'No change'
403 |
404 | var container = d3
405 | .select('svg')
406 | .append('g')
407 | .attr('class', 'legend legend' + '-' + order)
408 |
409 | var x = 10
410 | var y = 10
411 |
412 | if (order === 'first') {
413 | x = (4 * size) / 5
414 | y = (1 * size) / 5
415 | }
416 |
417 | if (order === 'second') {
418 | x = (1 * size) / 5 - 15
419 | y = (1 * size) / 5 - 20
420 | }
421 |
422 | if (order === 'third') {
423 | x = (1 * size) / 5 - 15
424 | y = (4 * size) / 5 + 15
425 | }
426 |
427 | if (order === 'fourth') {
428 | x = (4 * size) / 5
429 | y = (4 * size) / 5
430 | }
431 |
432 | d3.select('.legend')
433 | .attr('class', 'legend legend-' + order)
434 | .transition()
435 | .style('visibility', 'visible')
436 |
437 | triangleLegend(x, y, container)
438 |
439 | container
440 | .append('text')
441 | .attr('x', x + 15)
442 | .attr('y', y + 5)
443 | .attr('font-size', '0.8em')
444 | .text(triangleKey)
445 |
446 | circleLegend(x, y + 20, container)
447 |
448 | container
449 | .append('text')
450 | .attr('x', x + 15)
451 | .attr('y', y + 25)
452 | .attr('font-size', '0.8em')
453 | .text(circleKey)
454 | }
455 |
456 | function redrawFullRadar() {
457 | removeHomeLink()
458 | removeRadarLegend()
459 | tip.hide()
460 | d3.selectAll('g.blip-link').attr('opacity', 1.0)
461 |
462 | svg.style('left', 0).style('right', 0)
463 |
464 | d3.selectAll('.button').classed('selected', false).classed('full-view', true)
465 |
466 | d3.selectAll('.quadrant-table').classed('selected', false)
467 | d3.selectAll('.home-link').classed('selected', false)
468 |
469 | d3.selectAll('.quadrant-group').transition().duration(ANIMATION_DURATION).attr('transform', 'scale(1)')
470 |
471 | d3.selectAll('.quadrant-group .blip-link').transition().duration(ANIMATION_DURATION).attr('transform', 'scale(1)')
472 |
473 | d3.selectAll('.quadrant-group').style('pointer-events', 'auto')
474 | }
475 |
476 | function searchBlip(_e, ui) {
477 | const { blip, quadrant } = ui.item
478 | const isQuadrantSelected = d3.select('div.button.' + quadrant.order).classed('selected')
479 | selectQuadrant.bind({}, quadrant.order, quadrant.startAngle)()
480 | const selectedDesc = d3.select('#blip-description-' + blip.number())
481 | d3.select('.blip-item-description.expanded').node() !== selectedDesc.node() &&
482 | d3.select('.blip-item-description.expanded').classed('expanded', false)
483 | selectedDesc.classed('expanded', true)
484 |
485 | d3.selectAll('g.blip-link').attr('opacity', 0.3)
486 | const group = d3.select('#blip-link-' + blip.number())
487 | group.attr('opacity', 1.0)
488 | d3.selectAll('.blip-list-item').classed('highlight', false)
489 | d3.select('#blip-list-item-' + blip.number()).classed('highlight', true)
490 | if (isQuadrantSelected) {
491 | tip.show(blip.name(), group.node())
492 | } else {
493 | // need to account for the animation time associated with selecting a quadrant
494 | tip.hide()
495 |
496 | setTimeout(function () {
497 | tip.show(blip.name(), group.node())
498 | }, ANIMATION_DURATION)
499 | }
500 | }
501 |
502 | function plotRadarHeader() {
503 | header = d3.select('body').insert('header', '#radar')
504 | header
505 | .append('div')
506 | .attr('class', 'radar-title')
507 | .append('div')
508 | .attr('class', 'radar-title__text')
509 | .append('h1')
510 | .text(document.title)
511 | .style('cursor', 'pointer')
512 | .on('click', redrawFullRadar)
513 |
514 | header
515 | .select('.radar-title')
516 | .append('div')
517 | .attr('class', 'radar-title__logo')
518 | .html('')
519 |
520 | buttonsGroup = header.append('div').classed('buttons-group', true)
521 |
522 | quadrantButtons = buttonsGroup.append('div').classed('quadrant-btn--group', true)
523 |
524 | alternativeDiv = header.append('div').attr('id', 'alternative-buttons')
525 |
526 | return header
527 | }
528 |
529 | function plotHeader() {
530 | document.querySelector('.hero-banner__title-text').innerHTML = document.title
531 | const radarWrapper = d3.select('main .graph-placeholder')
532 | document.querySelector('.hero-banner__title-text').addEventListener('click', redrawFullRadar)
533 |
534 | buttonsGroup = radarWrapper.append('div').classed('buttons-group', true)
535 |
536 | quadrantButtons = buttonsGroup.append('div').classed('quadrant-btn--group', true)
537 |
538 | alternativeDiv = radarWrapper.append('div').attr('id', 'alternative-buttons')
539 |
540 | return radarWrapper
541 | }
542 |
543 | function plotQuadrantButtons(quadrants) {
544 | function addButton(quadrant) {
545 | radarElement.append('div').attr('class', 'quadrant-table ' + quadrant.order)
546 |
547 | quadrantButtons
548 | .append('div')
549 | .attr('class', 'button ' + quadrant.order + ' full-view')
550 | .text(quadrant.quadrant.name())
551 | .on('mouseover', mouseoverQuadrant.bind({}, quadrant.order))
552 | .on('mouseout', mouseoutQuadrant.bind({}, quadrant.order))
553 | .on('click', selectQuadrant.bind({}, quadrant.order, quadrant.startAngle))
554 | }
555 |
556 | _.each([0, 1, 2, 3], function (i) {
557 | addButton(quadrants[i])
558 | })
559 |
560 | buttonsGroup
561 | .append('div')
562 | .classed('print-radar-btn', true)
563 | .append('div')
564 | .classed('print-radar button no-capitalize', true)
565 | .text('Print this radar')
566 | .on('click', window.print.bind(window))
567 |
568 | alternativeDiv
569 | .append('div')
570 | .classed('search-box', true)
571 | .append('input')
572 | .attr('id', 'auto-complete')
573 | .attr('placeholder', 'Search')
574 | .classed('search-radar', true)
575 |
576 | AutoComplete('#auto-complete', quadrants, searchBlip)
577 | }
578 |
579 | function plotRadarFooter() {
580 | d3.select('body')
581 | .insert('div', '#radar-plot + *')
582 | .attr('id', 'footer')
583 | .append('div')
584 | .attr('class', 'footer-content')
585 | .append('p')
586 | .html(
587 | 'Powered by Thoughtworks. ' +
588 | 'By using this service you agree to Thoughtworks\' terms of use. ' +
589 | 'You also agree to our privacy policy, which describes how we will gather, use and protect any personal data contained in your public Google Sheet. ' +
590 | 'This software is open source and available for download and self-hosting.',
591 | )
592 | }
593 |
594 | function mouseoverQuadrant(order) {
595 | d3.select('.quadrant-group-' + order).style('opacity', 1)
596 | d3.selectAll('.quadrant-group:not(.quadrant-group-' + order + ')').style('opacity', 0.3)
597 | }
598 |
599 | function mouseoutQuadrant(order) {
600 | d3.selectAll('.quadrant-group:not(.quadrant-group-' + order + ')').style('opacity', 1)
601 | }
602 |
603 | function selectQuadrant(order, startAngle) {
604 | d3.selectAll('.home-link').classed('selected', false)
605 | createHomeLink(d3.select('header'))
606 |
607 | d3.selectAll('.button').classed('selected', false).classed('full-view', false)
608 | d3.selectAll('.button.' + order).classed('selected', true)
609 | d3.selectAll('.quadrant-table').classed('selected', false)
610 | d3.selectAll('.quadrant-table.' + order).classed('selected', true)
611 | d3.selectAll('.blip-item-description').classed('expanded', false)
612 |
613 | var scale = 2
614 |
615 | var adjustX = Math.sin(toRadian(startAngle)) - Math.cos(toRadian(startAngle))
616 | var adjustY = Math.cos(toRadian(startAngle)) + Math.sin(toRadian(startAngle))
617 |
618 | var translateX = ((-1 * (1 + adjustX) * size) / 2) * (scale - 1) + -adjustX * (1 - scale / 2) * size
619 | var translateY = -1 * (1 - adjustY) * (size / 2 - 7) * (scale - 1) - ((1 - adjustY) / 2) * (1 - scale / 2) * size
620 |
621 | var translateXAll = (((1 - adjustX) / 2) * size * scale) / 2 + ((1 - adjustX) / 2) * (1 - scale / 2) * size
622 | var translateYAll = (((1 + adjustY) / 2) * size * scale) / 2
623 |
624 | var moveRight = ((1 + adjustX) * (0.8 * window.innerWidth - size)) / 2
625 | var moveLeft = ((1 - adjustX) * (0.8 * window.innerWidth - size)) / 2
626 |
627 | var blipScale = 3 / 4
628 | var blipTranslate = (1 - blipScale) / blipScale
629 |
630 | svg.style('left', moveLeft + 'px').style('right', moveRight + 'px')
631 | d3.select('.quadrant-group-' + order)
632 | .transition()
633 | .duration(ANIMATION_DURATION)
634 | .attr('transform', 'translate(' + translateX + ',' + translateY + ')scale(' + scale + ')')
635 | d3.selectAll('.quadrant-group-' + order + ' .blip-link text').each(function () {
636 | var x = d3.select(this).attr('x')
637 | var y = d3.select(this).attr('y')
638 | d3.select(this.parentNode)
639 | .transition()
640 | .duration(ANIMATION_DURATION)
641 | .attr('transform', 'scale(' + blipScale + ')translate(' + blipTranslate * x + ',' + blipTranslate * y + ')')
642 | })
643 |
644 | d3.selectAll('.quadrant-group').style('pointer-events', 'auto')
645 |
646 | d3.selectAll('.quadrant-group:not(.quadrant-group-' + order + ')')
647 | .transition()
648 | .duration(ANIMATION_DURATION)
649 | .style('pointer-events', 'none')
650 | .attr('transform', 'translate(' + translateXAll + ',' + translateYAll + ')scale(0)')
651 |
652 | if (d3.select('.legend.legend-' + order).empty()) {
653 | drawLegend(order)
654 | }
655 | }
656 |
657 | self.init = function () {
658 | const selector = config.featureToggles.UIRefresh2022 ? 'main' : 'body'
659 | radarElement = d3.select(selector).append('div').attr('id', 'radar')
660 | return self
661 | }
662 |
663 | function constructSheetUrl(sheetName) {
664 | var noParamUrl = window.location.href.substring(0, window.location.href.indexOf(window.location.search))
665 | var queryParams = QueryParams(window.location.search.substring(1))
666 | var sheetUrl = noParamUrl + '?sheetId=' + queryParams.sheetId + '&sheetName=' + encodeURIComponent(sheetName)
667 | return sheetUrl
668 | }
669 |
670 | function plotAlternativeRadars(alternatives, currentSheet) {
671 | var alternativeSheetButton = alternativeDiv.append('div').classed('multiple-sheet-button-group', true)
672 |
673 | alternativeSheetButton.append('p').text('Choose a sheet to populate radar')
674 | alternatives.forEach(function (alternative) {
675 | alternativeSheetButton
676 | .append('div:a')
677 | .attr('class', 'first full-view alternative multiple-sheet-button')
678 | .attr('href', constructSheetUrl(alternative))
679 | .text(alternative)
680 |
681 | if (alternative === currentSheet) {
682 | d3.selectAll('.alternative')
683 | .filter(function () {
684 | return d3.select(this).text() === alternative
685 | })
686 | .attr('class', 'highlight multiple-sheet-button')
687 | }
688 | })
689 | }
690 |
691 | self.plot = function () {
692 | var rings, quadrants, alternatives, currentSheet
693 |
694 | rings = radar.rings()
695 | quadrants = radar.quadrants()
696 | alternatives = radar.getAlternatives()
697 | currentSheet = radar.getCurrentSheet()
698 |
699 | if (config.featureToggles.UIRefresh2022) {
700 | const landingPageElements = document.querySelectorAll('main .home-page')
701 | landingPageElements.forEach((elem) => {
702 | elem.style.display = 'none'
703 | })
704 | plotHeader()
705 | } else {
706 | plotRadarHeader()
707 | plotRadarFooter()
708 | }
709 |
710 | if (alternatives.length) {
711 | plotAlternativeRadars(alternatives, currentSheet)
712 | }
713 |
714 | plotQuadrantButtons(quadrants)
715 |
716 | radarElement.style('height', size + 14 + 'px')
717 | svg = radarElement.append('svg').call(tip)
718 | svg
719 | .attr('id', 'radar-plot')
720 | .attr('width', size)
721 | .attr('height', size + 14)
722 |
723 | _.each(quadrants, function (quadrant) {
724 | var quadrantGroup = plotQuadrant(rings, quadrant)
725 | plotLines(quadrantGroup, quadrant)
726 | plotTexts(quadrantGroup, rings, quadrant)
727 | plotBlips(quadrantGroup, rings, quadrant)
728 | })
729 | }
730 |
731 | return self
732 | }
733 |
734 | module.exports = Radar
735 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Bruno Trecenti
2 | Copyright (c) 2016 Thoughtworks, Inc
3 |
4 | GNU AFFERO GENERAL PUBLIC LICENSE
5 | Version 3, 19 November 2007
6 |
7 | Copyright (C) 2007 Free Software Foundation, Inc.
8 | Everyone is permitted to copy and distribute verbatim copies
9 | of this license document, but changing it is not allowed.
10 |
11 | Preamble
12 |
13 | The GNU Affero General Public License is a free, copyleft license for
14 | software and other kinds of works, specifically designed to ensure
15 | cooperation with the community in the case of network server software.
16 |
17 | The licenses for most software and other practical works are designed
18 | to take away your freedom to share and change the works. By contrast,
19 | our General Public Licenses are intended to guarantee your freedom to
20 | share and change all versions of a program--to make sure it remains free
21 | software for all its users.
22 |
23 | When we speak of free software, we are referring to freedom, not
24 | price. Our General Public Licenses are designed to make sure that you
25 | have the freedom to distribute copies of free software (and charge for
26 | them if you wish), that you receive source code or can get it if you
27 | want it, that you can change the software or use pieces of it in new
28 | free programs, and that you know you can do these things.
29 |
30 | Developers that use our General Public Licenses protect your rights
31 | with two steps: (1) assert copyright on the software, and (2) offer
32 | you this License which gives you legal permission to copy, distribute
33 | and/or modify the software.
34 |
35 | A secondary benefit of defending all users' freedom is that
36 | improvements made in alternate versions of the program, if they
37 | receive widespread use, become available for other developers to
38 | incorporate. Many developers of free software are heartened and
39 | encouraged by the resulting cooperation. However, in the case of
40 | software used on network servers, this result may fail to come about.
41 | The GNU General Public License permits making a modified version and
42 | letting the public access it on a server without ever releasing its
43 | source code to the public.
44 |
45 | The GNU Affero General Public License is designed specifically to
46 | ensure that, in such cases, the modified source code becomes available
47 | to the community. It requires the operator of a network server to
48 | provide the source code of the modified version running there to the
49 | users of that server. Therefore, public use of a modified version, on
50 | a publicly accessible server, gives the public access to the source
51 | code of the modified version.
52 |
53 | An older license, called the Affero General Public License and
54 | published by Affero, was designed to accomplish similar goals. This is
55 | a different license, not a version of the Affero GPL, but Affero has
56 | released a new version of the Affero GPL which permits relicensing under
57 | this license.
58 |
59 | The precise terms and conditions for copying, distribution and
60 | modification follow.
61 |
62 | TERMS AND CONDITIONS
63 |
64 | 0. Definitions.
65 |
66 | "This License" refers to version 3 of the GNU Affero General Public License.
67 |
68 | "Copyright" also means copyright-like laws that apply to other kinds of
69 | works, such as semiconductor masks.
70 |
71 | "The Program" refers to any copyrightable work licensed under this
72 | License. Each licensee is addressed as "you". "Licensees" and
73 | "recipients" may be individuals or organizations.
74 |
75 | To "modify" a work means to copy from or adapt all or part of the work
76 | in a fashion requiring copyright permission, other than the making of an
77 | exact copy. The resulting work is called a "modified version" of the
78 | earlier work or a work "based on" the earlier work.
79 |
80 | A "covered work" means either the unmodified Program or a work based
81 | on the Program.
82 |
83 | To "propagate" a work means to do anything with it that, without
84 | permission, would make you directly or secondarily liable for
85 | infringement under applicable copyright law, except executing it on a
86 | computer or modifying a private copy. Propagation includes copying,
87 | distribution (with or without modification), making available to the
88 | public, and in some countries other activities as well.
89 |
90 | To "convey" a work means any kind of propagation that enables other
91 | parties to make or receive copies. Mere interaction with a user through
92 | a computer network, with no transfer of a copy, is not conveying.
93 |
94 | An interactive user interface displays "Appropriate Legal Notices"
95 | to the extent that it includes a convenient and prominently visible
96 | feature that (1) displays an appropriate copyright notice, and (2)
97 | tells the user that there is no warranty for the work (except to the
98 | extent that warranties are provided), that licensees may convey the
99 | work under this License, and how to view a copy of this License. If
100 | the interface presents a list of user commands or options, such as a
101 | menu, a prominent item in the list meets this criterion.
102 |
103 | 1. Source Code.
104 |
105 | The "source code" for a work means the preferred form of the work
106 | for making modifications to it. "Object code" means any non-source
107 | form of a work.
108 |
109 | A "Standard Interface" means an interface that either is an official
110 | standard defined by a recognized standards body, or, in the case of
111 | interfaces specified for a particular programming language, one that
112 | is widely used among developers working in that language.
113 |
114 | The "System Libraries" of an executable work include anything, other
115 | than the work as a whole, that (a) is included in the normal form of
116 | packaging a Major Component, but which is not part of that Major
117 | Component, and (b) serves only to enable use of the work with that
118 | Major Component, or to implement a Standard Interface for which an
119 | implementation is available to the public in source code form. A
120 | "Major Component", in this context, means a major essential component
121 | (kernel, window system, and so on) of the specific operating system
122 | (if any) on which the executable work runs, or a compiler used to
123 | produce the work, or an object code interpreter used to run it.
124 |
125 | The "Corresponding Source" for a work in object code form means all
126 | the source code needed to generate, install, and (for an executable
127 | work) run the object code and to modify the work, including scripts to
128 | control those activities. However, it does not include the work's
129 | System Libraries, or general-purpose tools or generally available free
130 | programs which are used unmodified in performing those activities but
131 | which are not part of the work. For example, Corresponding Source
132 | includes interface definition files associated with source files for
133 | the work, and the source code for shared libraries and dynamically
134 | linked subprograms that the work is specifically designed to require,
135 | such as by intimate data communication or control flow between those
136 | subprograms and other parts of the work.
137 |
138 | The Corresponding Source need not include anything that users
139 | can regenerate automatically from other parts of the Corresponding
140 | Source.
141 |
142 | The Corresponding Source for a work in source code form is that
143 | same work.
144 |
145 | 2. Basic Permissions.
146 |
147 | All rights granted under this License are granted for the term of
148 | copyright on the Program, and are irrevocable provided the stated
149 | conditions are met. This License explicitly affirms your unlimited
150 | permission to run the unmodified Program. The output from running a
151 | covered work is covered by this License only if the output, given its
152 | content, constitutes a covered work. This License acknowledges your
153 | rights of fair use or other equivalent, as provided by copyright law.
154 |
155 | You may make, run and propagate covered works that you do not
156 | convey, without conditions so long as your license otherwise remains
157 | in force. You may convey covered works to others for the sole purpose
158 | of having them make modifications exclusively for you, or provide you
159 | with facilities for running those works, provided that you comply with
160 | the terms of this License in conveying all material for which you do
161 | not control copyright. Those thus making or running the covered works
162 | for you must do so exclusively on your behalf, under your direction
163 | and control, on terms that prohibit them from making any copies of
164 | your copyrighted material outside their relationship with you.
165 |
166 | Conveying under any other circumstances is permitted solely under
167 | the conditions stated below. Sublicensing is not allowed; section 10
168 | makes it unnecessary.
169 |
170 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
171 |
172 | No covered work shall be deemed part of an effective technological
173 | measure under any applicable law fulfilling obligations under article
174 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
175 | similar laws prohibiting or restricting circumvention of such
176 | measures.
177 |
178 | When you convey a covered work, you waive any legal power to forbid
179 | circumvention of technological measures to the extent such circumvention
180 | is effected by exercising rights under this License with respect to
181 | the covered work, and you disclaim any intention to limit operation or
182 | modification of the work as a means of enforcing, against the work's
183 | users, your or third parties' legal rights to forbid circumvention of
184 | technological measures.
185 |
186 | 4. Conveying Verbatim Copies.
187 |
188 | You may convey verbatim copies of the Program's source code as you
189 | receive it, in any medium, provided that you conspicuously and
190 | appropriately publish on each copy an appropriate copyright notice;
191 | keep intact all notices stating that this License and any
192 | non-permissive terms added in accord with section 7 apply to the code;
193 | keep intact all notices of the absence of any warranty; and give all
194 | recipients a copy of this License along with the Program.
195 |
196 | You may charge any price or no price for each copy that you convey,
197 | and you may offer support or warranty protection for a fee.
198 |
199 | 5. Conveying Modified Source Versions.
200 |
201 | You may convey a work based on the Program, or the modifications to
202 | produce it from the Program, in the form of source code under the
203 | terms of section 4, provided that you also meet all of these conditions:
204 |
205 | a) The work must carry prominent notices stating that you modified
206 | it, and giving a relevant date.
207 |
208 | b) The work must carry prominent notices stating that it is
209 | released under this License and any conditions added under section
210 | 7. This requirement modifies the requirement in section 4 to
211 | "keep intact all notices".
212 |
213 | c) You must license the entire work, as a whole, under this
214 | License to anyone who comes into possession of a copy. This
215 | License will therefore apply, along with any applicable section 7
216 | additional terms, to the whole of the work, and all its parts,
217 | regardless of how they are packaged. This License gives no
218 | permission to license the work in any other way, but it does not
219 | invalidate such permission if you have separately received it.
220 |
221 | d) If the work has interactive user interfaces, each must display
222 | Appropriate Legal Notices; however, if the Program has interactive
223 | interfaces that do not display Appropriate Legal Notices, your
224 | work need not make them do so.
225 |
226 | A compilation of a covered work with other separate and independent
227 | works, which are not by their nature extensions of the covered work,
228 | and which are not combined with it such as to form a larger program,
229 | in or on a volume of a storage or distribution medium, is called an
230 | "aggregate" if the compilation and its resulting copyright are not
231 | used to limit the access or legal rights of the compilation's users
232 | beyond what the individual works permit. Inclusion of a covered work
233 | in an aggregate does not cause this License to apply to the other
234 | parts of the aggregate.
235 |
236 | 6. Conveying Non-Source Forms.
237 |
238 | You may convey a covered work in object code form under the terms
239 | of sections 4 and 5, provided that you also convey the
240 | machine-readable Corresponding Source under the terms of this License,
241 | in one of these ways:
242 |
243 | a) Convey the object code in, or embodied in, a physical product
244 | (including a physical distribution medium), accompanied by the
245 | Corresponding Source fixed on a durable physical medium
246 | customarily used for software interchange.
247 |
248 | b) Convey the object code in, or embodied in, a physical product
249 | (including a physical distribution medium), accompanied by a
250 | written offer, valid for at least three years and valid for as
251 | long as you offer spare parts or customer support for that product
252 | model, to give anyone who possesses the object code either (1) a
253 | copy of the Corresponding Source for all the software in the
254 | product that is covered by this License, on a durable physical
255 | medium customarily used for software interchange, for a price no
256 | more than your reasonable cost of physically performing this
257 | conveying of source, or (2) access to copy the
258 | Corresponding Source from a network server at no charge.
259 |
260 | c) Convey individual copies of the object code with a copy of the
261 | written offer to provide the Corresponding Source. This
262 | alternative is allowed only occasionally and noncommercially, and
263 | only if you received the object code with such an offer, in accord
264 | with subsection 6b.
265 |
266 | d) Convey the object code by offering access from a designated
267 | place (gratis or for a charge), and offer equivalent access to the
268 | Corresponding Source in the same way through the same place at no
269 | further charge. You need not require recipients to copy the
270 | Corresponding Source along with the object code. If the place to
271 | copy the object code is a network server, the Corresponding Source
272 | may be on a different server (operated by you or a third party)
273 | that supports equivalent copying facilities, provided you maintain
274 | clear directions next to the object code saying where to find the
275 | Corresponding Source. Regardless of what server hosts the
276 | Corresponding Source, you remain obligated to ensure that it is
277 | available for as long as needed to satisfy these requirements.
278 |
279 | e) Convey the object code using peer-to-peer transmission, provided
280 | you inform other peers where the object code and Corresponding
281 | Source of the work are being offered to the general public at no
282 | charge under subsection 6d.
283 |
284 | A separable portion of the object code, whose source code is excluded
285 | from the Corresponding Source as a System Library, need not be
286 | included in conveying the object code work.
287 |
288 | A "User Product" is either (1) a "consumer product", which means any
289 | tangible personal property which is normally used for personal, family,
290 | or household purposes, or (2) anything designed or sold for incorporation
291 | into a dwelling. In determining whether a product is a consumer product,
292 | doubtful cases shall be resolved in favor of coverage. For a particular
293 | product received by a particular user, "normally used" refers to a
294 | typical or common use of that class of product, regardless of the status
295 | of the particular user or of the way in which the particular user
296 | actually uses, or expects or is expected to use, the product. A product
297 | is a consumer product regardless of whether the product has substantial
298 | commercial, industrial or non-consumer uses, unless such uses represent
299 | the only significant mode of use of the product.
300 |
301 | "Installation Information" for a User Product means any methods,
302 | procedures, authorization keys, or other information required to install
303 | and execute modified versions of a covered work in that User Product from
304 | a modified version of its Corresponding Source. The information must
305 | suffice to ensure that the continued functioning of the modified object
306 | code is in no case prevented or interfered with solely because
307 | modification has been made.
308 |
309 | If you convey an object code work under this section in, or with, or
310 | specifically for use in, a User Product, and the conveying occurs as
311 | part of a transaction in which the right of possession and use of the
312 | User Product is transferred to the recipient in perpetuity or for a
313 | fixed term (regardless of how the transaction is characterized), the
314 | Corresponding Source conveyed under this section must be accompanied
315 | by the Installation Information. But this requirement does not apply
316 | if neither you nor any third party retains the ability to install
317 | modified object code on the User Product (for example, the work has
318 | been installed in ROM).
319 |
320 | The requirement to provide Installation Information does not include a
321 | requirement to continue to provide support service, warranty, or updates
322 | for a work that has been modified or installed by the recipient, or for
323 | the User Product in which it has been modified or installed. Access to a
324 | network may be denied when the modification itself materially and
325 | adversely affects the operation of the network or violates the rules and
326 | protocols for communication across the network.
327 |
328 | Corresponding Source conveyed, and Installation Information provided,
329 | in accord with this section must be in a format that is publicly
330 | documented (and with an implementation available to the public in
331 | source code form), and must require no special password or key for
332 | unpacking, reading or copying.
333 |
334 | 7. Additional Terms.
335 |
336 | "Additional permissions" are terms that supplement the terms of this
337 | License by making exceptions from one or more of its conditions.
338 | Additional permissions that are applicable to the entire Program shall
339 | be treated as though they were included in this License, to the extent
340 | that they are valid under applicable law. If additional permissions
341 | apply only to part of the Program, that part may be used separately
342 | under those permissions, but the entire Program remains governed by
343 | this License without regard to the additional permissions.
344 |
345 | When you convey a copy of a covered work, you may at your option
346 | remove any additional permissions from that copy, or from any part of
347 | it. (Additional permissions may be written to require their own
348 | removal in certain cases when you modify the work.) You may place
349 | additional permissions on material, added by you to a covered work,
350 | for which you have or can give appropriate copyright permission.
351 |
352 | Notwithstanding any other provision of this License, for material you
353 | add to a covered work, you may (if authorized by the copyright holders of
354 | that material) supplement the terms of this License with terms:
355 |
356 | a) Disclaiming warranty or limiting liability differently from the
357 | terms of sections 15 and 16 of this License; or
358 |
359 | b) Requiring preservation of specified reasonable legal notices or
360 | author attributions in that material or in the Appropriate Legal
361 | Notices displayed by works containing it; or
362 |
363 | c) Prohibiting misrepresentation of the origin of that material, or
364 | requiring that modified versions of such material be marked in
365 | reasonable ways as different from the original version; or
366 |
367 | d) Limiting the use for publicity purposes of names of licensors or
368 | authors of the material; or
369 |
370 | e) Declining to grant rights under trademark law for use of some
371 | trade names, trademarks, or service marks; or
372 |
373 | f) Requiring indemnification of licensors and authors of that
374 | material by anyone who conveys the material (or modified versions of
375 | it) with contractual assumptions of liability to the recipient, for
376 | any liability that these contractual assumptions directly impose on
377 | those licensors and authors.
378 |
379 | All other non-permissive additional terms are considered "further
380 | restrictions" within the meaning of section 10. If the Program as you
381 | received it, or any part of it, contains a notice stating that it is
382 | governed by this License along with a term that is a further
383 | restriction, you may remove that term. If a license document contains
384 | a further restriction but permits relicensing or conveying under this
385 | License, you may add to a covered work material governed by the terms
386 | of that license document, provided that the further restriction does
387 | not survive such relicensing or conveying.
388 |
389 | If you add terms to a covered work in accord with this section, you
390 | must place, in the relevant source files, a statement of the
391 | additional terms that apply to those files, or a notice indicating
392 | where to find the applicable terms.
393 |
394 | Additional terms, permissive or non-permissive, may be stated in the
395 | form of a separately written license, or stated as exceptions;
396 | the above requirements apply either way.
397 |
398 | 8. Termination.
399 |
400 | You may not propagate or modify a covered work except as expressly
401 | provided under this License. Any attempt otherwise to propagate or
402 | modify it is void, and will automatically terminate your rights under
403 | this License (including any patent licenses granted under the third
404 | paragraph of section 11).
405 |
406 | However, if you cease all violation of this License, then your
407 | license from a particular copyright holder is reinstated (a)
408 | provisionally, unless and until the copyright holder explicitly and
409 | finally terminates your license, and (b) permanently, if the copyright
410 | holder fails to notify you of the violation by some reasonable means
411 | prior to 60 days after the cessation.
412 |
413 | Moreover, your license from a particular copyright holder is
414 | reinstated permanently if the copyright holder notifies you of the
415 | violation by some reasonable means, this is the first time you have
416 | received notice of violation of this License (for any work) from that
417 | copyright holder, and you cure the violation prior to 30 days after
418 | your receipt of the notice.
419 |
420 | Termination of your rights under this section does not terminate the
421 | licenses of parties who have received copies or rights from you under
422 | this License. If your rights have been terminated and not permanently
423 | reinstated, you do not qualify to receive new licenses for the same
424 | material under section 10.
425 |
426 | 9. Acceptance Not Required for Having Copies.
427 |
428 | You are not required to accept this License in order to receive or
429 | run a copy of the Program. Ancillary propagation of a covered work
430 | occurring solely as a consequence of using peer-to-peer transmission
431 | to receive a copy likewise does not require acceptance. However,
432 | nothing other than this License grants you permission to propagate or
433 | modify any covered work. These actions infringe copyright if you do
434 | not accept this License. Therefore, by modifying or propagating a
435 | covered work, you indicate your acceptance of this License to do so.
436 |
437 | 10. Automatic Licensing of Downstream Recipients.
438 |
439 | Each time you convey a covered work, the recipient automatically
440 | receives a license from the original licensors, to run, modify and
441 | propagate that work, subject to this License. You are not responsible
442 | for enforcing compliance by third parties with this License.
443 |
444 | An "entity transaction" is a transaction transferring control of an
445 | organization, or substantially all assets of one, or subdividing an
446 | organization, or merging organizations. If propagation of a covered
447 | work results from an entity transaction, each party to that
448 | transaction who receives a copy of the work also receives whatever
449 | licenses to the work the party's predecessor in interest had or could
450 | give under the previous paragraph, plus a right to possession of the
451 | Corresponding Source of the work from the predecessor in interest, if
452 | the predecessor has it or can get it with reasonable efforts.
453 |
454 | You may not impose any further restrictions on the exercise of the
455 | rights granted or affirmed under this License. For example, you may
456 | not impose a license fee, royalty, or other charge for exercise of
457 | rights granted under this License, and you may not initiate litigation
458 | (including a cross-claim or counterclaim in a lawsuit) alleging that
459 | any patent claim is infringed by making, using, selling, offering for
460 | sale, or importing the Program or any portion of it.
461 |
462 | 11. Patents.
463 |
464 | A "contributor" is a copyright holder who authorizes use under this
465 | License of the Program or a work on which the Program is based. The
466 | work thus licensed is called the contributor's "contributor version".
467 |
468 | A contributor's "essential patent claims" are all patent claims
469 | owned or controlled by the contributor, whether already acquired or
470 | hereafter acquired, that would be infringed by some manner, permitted
471 | by this License, of making, using, or selling its contributor version,
472 | but do not include claims that would be infringed only as a
473 | consequence of further modification of the contributor version. For
474 | purposes of this definition, "control" includes the right to grant
475 | patent sublicenses in a manner consistent with the requirements of
476 | this License.
477 |
478 | Each contributor grants you a non-exclusive, worldwide, royalty-free
479 | patent license under the contributor's essential patent claims, to
480 | make, use, sell, offer for sale, import and otherwise run, modify and
481 | propagate the contents of its contributor version.
482 |
483 | In the following three paragraphs, a "patent license" is any express
484 | agreement or commitment, however denominated, not to enforce a patent
485 | (such as an express permission to practice a patent or covenant not to
486 | sue for patent infringement). To "grant" such a patent license to a
487 | party means to make such an agreement or commitment not to enforce a
488 | patent against the party.
489 |
490 | If you convey a covered work, knowingly relying on a patent license,
491 | and the Corresponding Source of the work is not available for anyone
492 | to copy, free of charge and under the terms of this License, through a
493 | publicly available network server or other readily accessible means,
494 | then you must either (1) cause the Corresponding Source to be so
495 | available, or (2) arrange to deprive yourself of the benefit of the
496 | patent license for this particular work, or (3) arrange, in a manner
497 | consistent with the requirements of this License, to extend the patent
498 | license to downstream recipients. "Knowingly relying" means you have
499 | actual knowledge that, but for the patent license, your conveying the
500 | covered work in a country, or your recipient's use of the covered work
501 | in a country, would infringe one or more identifiable patents in that
502 | country that you have reason to believe are valid.
503 |
504 | If, pursuant to or in connection with a single transaction or
505 | arrangement, you convey, or propagate by procuring conveyance of, a
506 | covered work, and grant a patent license to some of the parties
507 | receiving the covered work authorizing them to use, propagate, modify
508 | or convey a specific copy of the covered work, then the patent license
509 | you grant is automatically extended to all recipients of the covered
510 | work and works based on it.
511 |
512 | A patent license is "discriminatory" if it does not include within
513 | the scope of its coverage, prohibits the exercise of, or is
514 | conditioned on the non-exercise of one or more of the rights that are
515 | specifically granted under this License. You may not convey a covered
516 | work if you are a party to an arrangement with a third party that is
517 | in the business of distributing software, under which you make payment
518 | to the third party based on the extent of your activity of conveying
519 | the work, and under which the third party grants, to any of the
520 | parties who would receive the covered work from you, a discriminatory
521 | patent license (a) in connection with copies of the covered work
522 | conveyed by you (or copies made from those copies), or (b) primarily
523 | for and in connection with specific products or compilations that
524 | contain the covered work, unless you entered into that arrangement,
525 | or that patent license was granted, prior to 28 March 2007.
526 |
527 | Nothing in this License shall be construed as excluding or limiting
528 | any implied license or other defenses to infringement that may
529 | otherwise be available to you under applicable patent law.
530 |
531 | 12. No Surrender of Others' Freedom.
532 |
533 | If conditions are imposed on you (whether by court order, agreement or
534 | otherwise) that contradict the conditions of this License, they do not
535 | excuse you from the conditions of this License. If you cannot convey a
536 | covered work so as to satisfy simultaneously your obligations under this
537 | License and any other pertinent obligations, then as a consequence you may
538 | not convey it at all. For example, if you agree to terms that obligate you
539 | to collect a royalty for further conveying from those to whom you convey
540 | the Program, the only way you could satisfy both those terms and this
541 | License would be to refrain entirely from conveying the Program.
542 |
543 | 13. Remote Network Interaction; Use with the GNU General Public License.
544 |
545 | Notwithstanding any other provision of this License, if you modify the
546 | Program, your modified version must prominently offer all users
547 | interacting with it remotely through a computer network (if your version
548 | supports such interaction) an opportunity to receive the Corresponding
549 | Source of your version by providing access to the Corresponding Source
550 | from a network server at no charge, through some standard or customary
551 | means of facilitating copying of software. This Corresponding Source
552 | shall include the Corresponding Source for any work covered by version 3
553 | of the GNU General Public License that is incorporated pursuant to the
554 | following paragraph.
555 |
556 | Notwithstanding any other provision of this License, you have
557 | permission to link or combine any covered work with a work licensed
558 | under version 3 of the GNU General Public License into a single
559 | combined work, and to convey the resulting work. The terms of this
560 | License will continue to apply to the part which is the covered work,
561 | but the work with which it is combined will remain governed by version
562 | 3 of the GNU General Public License.
563 |
564 | 14. Revised Versions of this License.
565 |
566 | The Free Software Foundation may publish revised and/or new versions of
567 | the GNU Affero General Public License from time to time. Such new versions
568 | will be similar in spirit to the present version, but may differ in detail to
569 | address new problems or concerns.
570 |
571 | Each version is given a distinguishing version number. If the
572 | Program specifies that a certain numbered version of the GNU Affero General
573 | Public License "or any later version" applies to it, you have the
574 | option of following the terms and conditions either of that numbered
575 | version or of any later version published by the Free Software
576 | Foundation. If the Program does not specify a version number of the
577 | GNU Affero General Public License, you may choose any version ever published
578 | by the Free Software Foundation.
579 |
580 | If the Program specifies that a proxy can decide which future
581 | versions of the GNU Affero General Public License can be used, that proxy's
582 | public statement of acceptance of a version permanently authorizes you
583 | to choose that version for the Program.
584 |
585 | Later license versions may give you additional or different
586 | permissions. However, no additional obligations are imposed on any
587 | author or copyright holder as a result of your choosing to follow a
588 | later version.
589 |
590 | 15. Disclaimer of Warranty.
591 |
592 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
593 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
594 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
595 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
596 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
597 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
598 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
599 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
600 |
601 | 16. Limitation of Liability.
602 |
603 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
604 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
605 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
606 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
607 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
608 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
609 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
610 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
611 | SUCH DAMAGES.
612 |
613 | 17. Interpretation of Sections 15 and 16.
614 |
615 | If the disclaimer of warranty and limitation of liability provided
616 | above cannot be given local legal effect according to their terms,
617 | reviewing courts shall apply local law that most closely approximates
618 | an absolute waiver of all civil liability in connection with the
619 | Program, unless a warranty or assumption of liability accompanies a
620 | copy of the Program in return for a fee.
621 |
622 | END OF TERMS AND CONDITIONS
623 |
624 | How to Apply These Terms to Your New Programs
625 |
626 | If you develop a new program, and you want it to be of the greatest
627 | possible use to the public, the best way to achieve this is to make it
628 | free software which everyone can redistribute and change under these terms.
629 |
630 | To do so, attach the following notices to the program. It is safest
631 | to attach them to the start of each source file to most effectively
632 | state the exclusion of warranty; and each file should have at least
633 | the "copyright" line and a pointer to where the full notice is found.
634 |
635 |
636 | Copyright (C)
637 |
638 | This program is free software: you can redistribute it and/or modify
639 | it under the terms of the GNU Affero General Public License as published
640 | by the Free Software Foundation, either version 3 of the License, or
641 | (at your option) any later version.
642 |
643 | This program is distributed in the hope that it will be useful,
644 | but WITHOUT ANY WARRANTY; without even the implied warranty of
645 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
646 | GNU Affero General Public License for more details.
647 |
648 | You should have received a copy of the GNU Affero General Public License
649 | along with this program. If not, see .
650 |
651 | Also add information on how to contact you by electronic and paper mail.
652 |
653 | If your software can interact with users remotely through a computer
654 | network, you should also make sure that it provides a way for users to
655 | get its source. For example, if your program is a web application, its
656 | interface could display a "Source" link that leads users to an archive
657 | of the code. There are many ways you could offer source, and different
658 | solutions will be better for different programs; see section 13 for the
659 | specific requirements.
660 |
661 | You should also get your employer (if you work as a programmer) or school,
662 | if any, to sign a "copyright disclaimer" for the program, if necessary.
663 | For more information on this, and how to apply and follow the GNU AGPL, see
664 | .
665 |
--------------------------------------------------------------------------------