Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

// MODULES //

var parseJSON = require( '@stdlib/utils/parse-json' );
var isJSON = require( '@stdlib/assert/is-json' );
var join = require( '@stdlib/array/base/join' );
var log = require( './../log.js' );
var config = require( './../config.js' );
Expand Down Expand Up @@ -67,6 +69,8 @@
var prop;
var path;
var url;
var tmp;
var val;
var obj;
var ns;
var i;
Expand All @@ -74,7 +78,7 @@
self = this;
conf = this._config;

// FIXME: other properties/objects

Check warning on line 81 in lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/on_change.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: other properties/objects'

obj = event.object;
if ( obj === conf.general ) {
Expand All @@ -100,13 +104,21 @@
// Convert namespace entries to a path:
path = join( ns, '/' );

val = event.value;
if ( isJSON( val ) ) {
tmp = parseJSON( val );
if ( !( tmp instanceof Error ) ) {
val = tmp;
}
}

log( 'Editor changed: %s/%s', path, prop );
this.emit( 'change', {
'type': 'change',
'source': 'editor',
'property': event.property,
'path': ns.concat( [ prop ] ),
'value': event.value
'value': val
});

log( 'Attempting to update configuration...' );
Expand All @@ -127,7 +139,7 @@
log( 'Successfully updated configuration.' );
return;
}
console.error( 'Encountered an error when posting change. Status: %d.', response.status );

Check warning on line 142 in lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/on_change.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected console statement

// If we failed, we need to roll back to displaying the value from the existing visualization schema:
self.refresh();
Expand All @@ -140,7 +152,7 @@
* @param {Error} error - error object
*/
function onError( error ) {
console.error( 'Encountered an error when posting change. Error: %s.', error.message );

Check warning on line 155 in lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/on_change.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected console statement

// If we failed, we need to roll back to displaying the value from the existing visualization schema:
self.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
// VARIABLES //

var PROPS = [
'domain',
'domainCap',
'domainColor',
'domainDash',
'domainDashOffset',
'domainOpacity',
'domainWidth',
'title',
'titleColor',
'titleFont',
Expand Down Expand Up @@ -69,9 +76,19 @@
'name': name,
'value': ( isUndefined( v ) ) ? defaults[ k ].default : v
});
out[ k ] = {
'signal': name
};

// FIXME: Vega does not currently support signal updates for structural properties like `domain`. As a workaround, we keep `domain` statically `true` and dynamically hide it by dropping `domainOpacity` to 0 when unchecked.

Check warning on line 80 in lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/axis.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: Vega does not currently support...'
if ( k === 'domain' ) {
out[ k ] = true;
} else if ( k === 'domainOpacity' ) {
out[ k ] = {
Comment thread
kgryte marked this conversation as resolved.
'signal': signalName( prefix+'domain' ) + ' ? ' + name + ' : 0'
Comment thread
kgryte marked this conversation as resolved.
};
} else {
out[ k ] = {
'signal': name
};
}
}
}
return out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function parameterize( url ) {
if ( re[ re.length-1 ] === '/' ) {
re = re.substring( re.length-1 ) + '\\/';
}
re = '^' + re + '$';
return {
'regexp': new RegExp( re ),
'names': names
Expand Down
Loading