Skip to content

Commit 81fd9c1

Browse files
author
oraclejet
committed
Update 2.0.0
1 parent c11bf3a commit 81fd9c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2933
-2836
lines changed

dist/js/libs/oj/debug/internal-deps/dvt/DvtChart.js

Lines changed: 96 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7638,7 +7638,7 @@ DvtDataCursor.prototype.getBehavior = function() {
76387638
DvtDataCursor.prototype.setBehavior = function(behavior) {
76397639
this._behavior = behavior;
76407640
};
7641-
// Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
7641+
// Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
76427642
/**
76437643
* Creates a funnel shape.
76447644
* @extends {DvtPath}
@@ -7710,19 +7710,37 @@ DvtFunnelSlice.prototype.Init = function(chart, seriesIndex, numDrawnSeries, fun
77107710

77117711
/** The ratio of rx/ry in the 3D funnel opening
77127712
* @private */
7713-
DvtFunnelSlice._FUNNEL_3D_WIDTH_RATIO = .12;
7713+
DvtFunnelSlice._FUNNEL_3D_WIDTH_RATIO = .08;
77147714
/** Angle for creating the funnel sides
77157715
* @private */
7716-
DvtFunnelSlice._FUNNEL_ANGLE_2D = 31;
7716+
DvtFunnelSlice._FUNNEL_ANGLE_2D = 36;
77177717
/** Ratio between the smallest and largest slices
77187718
* @private */
7719-
DvtFunnelSlice._FUNNEL_RATIO = 6 / 22;
7719+
DvtFunnelSlice._FUNNEL_RATIO = 1 / 3;
77207720
/** Color for funnel slice border. Could be overridden in styleDefaults.
77217721
* @private */
77227722
DvtFunnelSlice._BORDER_COLOR = '#FFFFFF';
77237723
/** Minimum number of characters to use when truncating.
77247724
* @private */
77257725
DvtFunnelSlice._MIN_CHARS_DATA_LABEL = 3;
7726+
/** Length of the first line.
7727+
* @private */
7728+
DvtFunnelSlice._LINE_FRACTION = 2 / 3;
7729+
/** Fraction into which the funnel area is divided by the first line.
7730+
* @private */
7731+
DvtFunnelSlice._AREA_FRACTION = 0.41;
7732+
/** Fraction into which the funnel height is divided by the first line.
7733+
* @private */
7734+
DvtFunnelSlice._HEIGHT_FRACTION = 0.28;
7735+
/** Length of the second line.
7736+
* @private */
7737+
DvtFunnelSlice._LINE_FRACTION_2 = 0.4;
7738+
/** Fraction into which the funnel area is divided by the second line.
7739+
* @private */
7740+
DvtFunnelSlice._AREA_FRACTION_2 = 0.8;
7741+
/** Fraction into which the funnel height is divided by the second line.
7742+
* @private */
7743+
DvtFunnelSlice._HEIGHT_FRACTION_2 = 0.7;
77267744

77277745

77287746
/**
@@ -7736,23 +7754,91 @@ DvtFunnelSlice.prototype._getPath = function() {
77367754
var offset = (this._numDrawnSeries + 1) * this._gap;
77377755
var angle = DvtMath.degreesToRads(DvtFunnelSlice._FUNNEL_ANGLE_2D - 2 * this._3dRatio);
77387756

7739-
var rx = (this._funnelWidth - (gapCount * this._gap)) / Math.sin(DvtMath.degreesToRads(DvtFunnelSlice._FUNNEL_ANGLE_2D));
7757+
var totalWidth = this._funnelWidth - gapCount * this._gap;
7758+
var rx = totalWidth / Math.sin(DvtMath.degreesToRads(DvtFunnelSlice._FUNNEL_ANGLE_2D));
77407759
var ry = this._funnelHeight / Math.sin(angle);
77417760
var ratio = this._3dRatio * this._funnelWidth / this._funnelHeight * DvtFunnelSlice._FUNNEL_3D_WIDTH_RATIO;
77427761
if (ratio < 0.00001)
77437762
ratio = 0;
7744-
var delta = angle * (1 - this._startPercent);
7745-
var gamma = angle * (1 - this._startPercent - this._valuePercent);
7763+
7764+
// Dividing the funnel into three trapezoids to come up with a better approximation for the dimensions. We draw two lines,
7765+
// at .28 and .7 of the height, and they split the area to the ratio .41: .39: .2.
7766+
var b1 = this._funnelHeight;
7767+
var b2 = this._funnelHeight * DvtFunnelSlice._FUNNEL_RATIO;
7768+
var p1, p2; // The percent at which we are calculating the width
7769+
var b11, b12, b21, b22; // The first and second base of the trapezoid into which the percent we are looking at falls.
7770+
var f1, f2; // The fraction of the area included in the trapezoid we are considering.
7771+
var t1, t2; // Total width of the trapezoid we are considering.
7772+
var h1, h2; // Horizontal distance from the slice to the center of the ellipse for drawing the funnel arcs.
7773+
7774+
// calculating first edge
7775+
if (this._startPercent < DvtFunnelSlice._AREA_FRACTION) {
7776+
p1 = this._startPercent;
7777+
b11 = b1;
7778+
b21 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION;
7779+
f1 = DvtFunnelSlice._AREA_FRACTION;
7780+
t1 = totalWidth * DvtFunnelSlice._HEIGHT_FRACTION;
7781+
h1 = totalWidth * (1 - DvtFunnelSlice._HEIGHT_FRACTION);
7782+
}
7783+
else if (this._startPercent < DvtFunnelSlice._AREA_FRACTION_2) {
7784+
p1 = this._startPercent - DvtFunnelSlice._AREA_FRACTION;
7785+
b11 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION;
7786+
b21 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION_2;
7787+
f1 = DvtFunnelSlice._AREA_FRACTION_2 - DvtFunnelSlice._AREA_FRACTION;
7788+
t1 = totalWidth * (DvtFunnelSlice._HEIGHT_FRACTION_2 - DvtFunnelSlice._HEIGHT_FRACTION);
7789+
h1 = totalWidth * (1 - DvtFunnelSlice._HEIGHT_FRACTION_2);
7790+
}
7791+
else {
7792+
p1 = this._startPercent - DvtFunnelSlice._AREA_FRACTION_2;
7793+
b11 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION_2;
7794+
b21 = b2;
7795+
f1 = 1 - DvtFunnelSlice._AREA_FRACTION_2;
7796+
t1 = totalWidth * (1 - DvtFunnelSlice._HEIGHT_FRACTION_2);
7797+
h1 = 0;
7798+
}
7799+
7800+
// Calculating second edge
7801+
if (this._startPercent + this._valuePercent < DvtFunnelSlice._AREA_FRACTION) {
7802+
b12 = b1;
7803+
b22 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION;
7804+
p2 = this._startPercent + this._valuePercent;
7805+
f2 = DvtFunnelSlice._AREA_FRACTION;
7806+
t2 = totalWidth * DvtFunnelSlice._HEIGHT_FRACTION;
7807+
h2 = totalWidth * (1 - DvtFunnelSlice._HEIGHT_FRACTION);
7808+
}
7809+
else if (this._startPercent + this._valuePercent < DvtFunnelSlice._AREA_FRACTION_2) {
7810+
b12 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION;
7811+
b22 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION_2;
7812+
p2 = this._startPercent + this._valuePercent - DvtFunnelSlice._AREA_FRACTION;
7813+
f2 = DvtFunnelSlice._AREA_FRACTION_2 - DvtFunnelSlice._AREA_FRACTION;
7814+
t2 = totalWidth * (DvtFunnelSlice._HEIGHT_FRACTION_2 - DvtFunnelSlice._HEIGHT_FRACTION);
7815+
h2 = totalWidth * (1 - DvtFunnelSlice._HEIGHT_FRACTION_2);
7816+
}
7817+
else {
7818+
b12 = this._funnelHeight * DvtFunnelSlice._LINE_FRACTION_2;
7819+
b22 = b2;
7820+
p2 = this._startPercent + this._valuePercent - DvtFunnelSlice._AREA_FRACTION_2;
7821+
f2 = 1 - DvtFunnelSlice._AREA_FRACTION_2;
7822+
t2 = totalWidth * (1 - DvtFunnelSlice._HEIGHT_FRACTION_2);
7823+
h2 = 0;
7824+
}
7825+
7826+
var w1 = Math.sqrt((f1 - p1) / f1 * b11 * b11 + p1 / f1 * b21 * b21);
7827+
var w2 = Math.sqrt((f2 - p2) / f2 * b12 * b12 + p2 / f2 * b22 * b22);
7828+
7829+
var startAngle = 0.98 * Math.asin((((w1 - b21) * (t1) / (b11 - b21)) + h1) / rx);
7830+
var endAngle = 0.98 * Math.asin((((w2 - b22) * (t2) / (b12 - b22)) + h2) / rx);
7831+
77467832
var c1 = (1 + DvtFunnelSlice._FUNNEL_RATIO) / 2 * this._funnelHeight + ry;
77477833
var c2 = (1 - DvtFunnelSlice._FUNNEL_RATIO) / 2 * this._funnelHeight - ry;
77487834
var ar, arcDir1, arcDir2;
77497835

77507836
if (isBiDi) {
7751-
ar = [rx * Math.sin(delta) + offset, c1 - ry * Math.cos(delta), rx * Math.sin(gamma) + offset, c1 - ry * Math.cos(gamma), rx * Math.sin(gamma) + offset, c2 + ry * Math.cos(gamma), rx * Math.sin(delta) + offset, c2 + ry * Math.cos(delta)];
7837+
ar = [rx * Math.sin(startAngle) + offset, c1 - ry * Math.cos(startAngle), rx * Math.sin(endAngle) + offset, c1 - ry * Math.cos(endAngle), rx * Math.sin(endAngle) + offset, c2 + ry * Math.cos(endAngle), rx * Math.sin(startAngle) + offset, c2 + ry * Math.cos(startAngle)];
77527838
arcDir1 = 0;
77537839
arcDir2 = 1;
77547840
} else {
7755-
ar = [this._funnelWidth - offset - rx * Math.sin(delta), c1 - ry * Math.cos(delta), this._funnelWidth - offset - rx * Math.sin(gamma), c1 - ry * Math.cos(gamma), this._funnelWidth - offset - rx * Math.sin(gamma), c2 + ry * Math.cos(gamma), this._funnelWidth - offset - rx * Math.sin(delta), c2 + ry * Math.cos(delta)];
7841+
ar = [this._funnelWidth - offset - rx * Math.sin(startAngle), c1 - ry * Math.cos(startAngle), this._funnelWidth - offset - rx * Math.sin(endAngle), c1 - ry * Math.cos(endAngle), this._funnelWidth - offset - rx * Math.sin(endAngle), c2 + ry * Math.cos(endAngle), this._funnelWidth - offset - rx * Math.sin(startAngle), c2 + ry * Math.cos(startAngle)];
77567842
arcDir1 = 1;
77577843
arcDir2 = 0;
77587844
}
@@ -7815,7 +7901,7 @@ DvtFunnelSlice.prototype._getSliceLabel = function(sliceBounds, barBounds) {
78157901
label.setCSSStyle(style);
78167902

78177903
// Truncating text and dropping if doesn't fit.
7818-
if (! DvtTextUtils.fitText(label, sliceBounds.h - 10, sliceBounds.w, this, DvtFunnelSlice._MIN_CHARS_DATA_LABEL))
7904+
if (! DvtTextUtils.fitText(label, sliceBounds.h - this._3dRatio * (0.8 - this._valuePercent) * 50, sliceBounds.w, this, DvtFunnelSlice._MIN_CHARS_DATA_LABEL))
78197905
return;
78207906

78217907
var textDim = label.measureDimensions();

dist/js/libs/oj/debug/oj.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ var _oldVal = _scope['oj'];
4444
var oj = _scope['oj'] =
4545
{
4646
'version': "2.0.0",
47-
'build' : "145",
48-
'revision': "23155",
47+
'build' : "163",
48+
'revision': "23387",
4949

5050
// This function is only meant to be used outside the library, so quoting the name
5151
// to avoid renaming is appropriate
@@ -45280,7 +45280,6 @@ oj.__registerWidget('oj.ojDataGrid', $['oj']['baseComponent'],
4528045280
this.search.focus();
4528145281

4528245282
this.container.addClass("oj-active");
45283-
_ComboUtils.killEvent(e);
4528445283
}
4528545284
));
4528645285

@@ -75329,12 +75328,18 @@ oj.DataSourceContentHandler.prototype.isSelectable = function(context)
7532975328

7533075329
oj.DataSourceContentHandler.prototype.signalTaskStart = function()
7533175330
{
75332-
this.m_widget.signalTaskStart();
75331+
if (this.m_widget) // check that widget exists (e.g. not destroyed)
75332+
{
75333+
this.m_widget.signalTaskStart();
75334+
}
7533375335
};
7533475336

7533575337
oj.DataSourceContentHandler.prototype.signalTaskEnd = function()
7533675338
{
75337-
this.m_widget.signalTaskEnd();
75339+
if (this.m_widget) // check that widget exists (e.g. not destroyed)
75340+
{
75341+
this.m_widget.signalTaskEnd();
75342+
}
7533875343
};
7533975344
/**
7534075345
* Handler for TableDataSource generated content
@@ -75717,7 +75722,7 @@ oj.TableDataSourceContentHandler.prototype.fetchRows = function(forceFetch)
7571775722
{
7571875723
self._handleFetchedData(value);
7571975724
// initial fetch we'll append the loading indicator at the end (for highwatermark scrolling)
75720-
if (self._isLoadMoreOnScroll())
75725+
if (self._isLoadMoreOnScroll() && value != null && value['keys'] && value['keys'].length > 0)
7572175726
{
7572275727
self._appendLoadingIndicator();
7572375728
}

dist/js/libs/oj/debug/ojcore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ var _oldVal = _scope['oj'];
4646
var oj = _scope['oj'] =
4747
{
4848
'version': "2.0.0",
49-
'build' : "145",
50-
'revision': "23155",
49+
'build' : "163",
50+
'revision': "23387",
5151

5252
// This function is only meant to be used outside the library, so quoting the name
5353
// to avoid renaming is appropriate

dist/js/libs/oj/debug/ojlistview.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,18 @@ oj.DataSourceContentHandler.prototype.isSelectable = function(context)
338338

339339
oj.DataSourceContentHandler.prototype.signalTaskStart = function()
340340
{
341-
this.m_widget.signalTaskStart();
341+
if (this.m_widget) // check that widget exists (e.g. not destroyed)
342+
{
343+
this.m_widget.signalTaskStart();
344+
}
342345
};
343346

344347
oj.DataSourceContentHandler.prototype.signalTaskEnd = function()
345348
{
346-
this.m_widget.signalTaskEnd();
349+
if (this.m_widget) // check that widget exists (e.g. not destroyed)
350+
{
351+
this.m_widget.signalTaskEnd();
352+
}
347353
};
348354
/**
349355
* Handler for TableDataSource generated content
@@ -726,7 +732,7 @@ oj.TableDataSourceContentHandler.prototype.fetchRows = function(forceFetch)
726732
{
727733
self._handleFetchedData(value);
728734
// initial fetch we'll append the loading indicator at the end (for highwatermark scrolling)
729-
if (self._isLoadMoreOnScroll())
735+
if (self._isLoadMoreOnScroll() && value != null && value['keys'] && value['keys'].length > 0)
730736
{
731737
self._appendLoadingIndicator();
732738
}

dist/js/libs/oj/debug/ojselectcombobox.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,6 @@ define(['ojs/ojcore', 'jquery', 'ojs/ojeditablevalue'],
25992599
this.search.focus();
26002600

26012601
this.container.addClass("oj-active");
2602-
_ComboUtils.killEvent(e);
26032602
}
26042603
));
26052604

0 commit comments

Comments
 (0)