Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge master into next #1084

Merged
merged 12 commits into from
Jul 1, 2024
Merged
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## Notice

The Apache Software Foundation [Apache ECharts, ECharts](https://echarts.apache.org/), Apache, the Apache feather, and the Apache ECharts project logo are either registered trademarks or trademarks of the [Apache Software Foundation](https://www.apache.org/).
4 changes: 2 additions & 2 deletions dist/zrender.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
else {
text = text || '';
font = font || DEFAULT_FONT;
var res = /(\d+)px/.exec(font);
var res = /((?:\d+)?\.?\d*)px/.exec(font);
var fontSize = res && +res[1] || DEFAULT_FONT_SIZE;
var width = 0;
if (font.indexOf('mono') >= 0) {
Expand Down Expand Up @@ -7338,7 +7338,7 @@
function registerSSRDataGetter(getter) {
ssrDataGetter = getter;
}
var version = '5.5.0';
var version = '5.6.0';

var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));
var DEFAULT_COMMON_STYLE = {
Expand Down
2 changes: 1 addition & 1 deletion dist/zrender.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/zrender.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zrender",
"version": "5.5.0",
"version": "5.6.0",
"description": "A lightweight graphic library providing 2d draw for Apache ECharts",
"keywords": [
"canvas",
Expand Down
5 changes: 3 additions & 2 deletions src/core/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ else if (typeof document === 'undefined' && typeof self !== 'undefined') {
env.worker = true;
}
else if (
typeof navigator === 'undefined'
|| navigator.userAgent.indexOf('Node.js') === 0
(typeof process !== 'undefined' && typeof process.version === 'string')
|| (typeof navigator === 'undefined' || typeof navigator.userAgent === 'undefined')
|| (env.hasGlobalWindow && 'Deno' in window)
) {
// In node
env.node = true;
Expand Down
4 changes: 2 additions & 2 deletions src/core/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const platformApi: Platform = {
text = text || '';
font = font || DEFAULT_FONT;
// Use font size if there is no other method can be used.
const res = /(\d+)px/.exec(font);
const res = /((?:\d+)?\.?\d*)px/.exec(font);
const fontSize = res && +res[1] || DEFAULT_FONT_SIZE;
let width = 0;
if (font.indexOf('mono') >= 0) { // is monospace
Expand Down Expand Up @@ -108,4 +108,4 @@ export function setPlatformAPI(newPlatformApis: Partial<Platform>) {
(platformApi as any)[key] = (newPlatformApis as any)[key];
}
}
}
}
1 change: 1 addition & 0 deletions src/svg/Painter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class SVGPainter implements PainterBase {
scope.willUpdate = opts.willUpdate;
scope.compress = opts.compress;
scope.emphasis = opts.emphasis;
scope.ssr = this._opts.ssr;

const children: SVGVNode[] = [];

Expand Down
2 changes: 2 additions & 0 deletions src/svg/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ export interface BrushScope {
* If compress the output string.
*/
compress?: boolean

ssr?: boolean
}

export function createBrushScope(zrId: string): BrushScope {
Expand Down
10 changes: 6 additions & 4 deletions src/svg/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ function setStyleAttrs(attrs: SVGVNodeAttrs, style: AllStyleOption, el: Path | T
else if (isFillStroke && isPattern(val)) {
setPattern(el, attrs, key, scope);
}
else if (isFillStroke && val === 'none') {
// When is none, it cannot be interacted when ssr
attrs[key] = 'transparent';
}
else {
attrs[key] = val;
}
if (isFillStroke && scope.ssr && val === 'none') {
// When is none, it cannot be interacted when ssr
// Setting `pointer-events` as `visible` to make it responding
// See also https://www.w3.org/TR/SVG/interact.html#PointerEventsProperty
attrs['pointer-events'] = 'visible';
}
}, style, el, false);

setShadow(el, attrs, scope);
Expand Down
2 changes: 1 addition & 1 deletion src/zrender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export function registerSSRDataGetter<T>(getter: ElementSSRDataGetter<T>) {
/**
* @type {string}
*/
export const version = '5.5.0';
export const version = '5.6.0';


export interface ZRenderType extends ZRender {};
Loading