Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
f753351a
Commit
f753351a
authored
Oct 25, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add functions asc_setAttribute and asc_setColor from sparklines
add c_oAscSparklineAttributes, c_oAscSparklineColors
parent
e373f8fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
163 additions
and
20 deletions
+163
-20
cell/apiDefines.js
cell/apiDefines.js
+54
-0
cell/model/UndoRedo.js
cell/model/UndoRedo.js
+3
-0
cell/model/Workbook.js
cell/model/Workbook.js
+1
-1
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+105
-19
No files found.
cell/apiDefines.js
View file @
f753351a
...
...
@@ -378,6 +378,34 @@ var c_oAscPopUpSelectorType = {
Custom
:
2
};
var
c_oAscSparklineAttributes
=
{
type
:
1
,
lineWeight
:
2
,
displayEmptyCellsAs
:
4
,
markers
:
8
,
high
:
16
,
low
:
32
,
first
:
64
,
last
:
128
,
negative
:
256
,
displayXAxis
:
512
,
displayHidden
:
1024
,
minAxisType
:
2048
,
maxAxisType
:
4096
,
rightToLeft
:
8192
};
var
c_oAscSparklineColors
=
{
Series
:
1
,
Negative
:
2
,
Axis
:
4
,
Markers
:
8
,
First
:
16
,
Last
:
32
,
High
:
64
,
Low
:
128
};
//----------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
window
[
'
AscCommonExcel
'
].
c_oAscAlignType
=
c_oAscAlignType
;
...
...
@@ -565,4 +593,30 @@ var c_oAscPopUpSelectorType = {
prot
[
'
Individual
'
]
=
prot
.
Individual
;
prot
[
'
Group
'
]
=
prot
.
Group
;
prot
[
'
Custom
'
]
=
prot
.
Custom
;
window
[
'
Asc
'
][
'
c_oAscSparklineAttributes
'
]
=
window
[
'
Asc
'
].
c_oAscSparklineAttributes
=
c_oAscSparklineAttributes
;
prot
=
c_oAscSparklineAttributes
;
prot
[
'
type
'
]
=
prot
.
type
;
prot
[
'
lineWeight
'
]
=
prot
.
lineWeight
;
prot
[
'
displayEmptyCellsAs
'
]
=
prot
.
displayEmptyCellsAs
;
prot
[
'
markers
'
]
=
prot
.
markers
;
prot
[
'
high
'
]
=
prot
.
high
;
prot
[
'
low
'
]
=
prot
.
low
;
prot
[
'
first
'
]
=
prot
.
first
;
prot
[
'
last
'
]
=
prot
.
last
;
prot
[
'
negative
'
]
=
prot
.
negative
;
prot
[
'
displayXAxis
'
]
=
prot
.
displayXAxis
;
prot
[
'
displayHidden
'
]
=
prot
.
displayHidden
;
prot
[
'
minAxisType
'
]
=
prot
.
minAxisType
;
prot
[
'
maxAxisType
'
]
=
prot
.
maxAxisType
;
prot
[
'
rightToLeft
'
]
=
prot
.
rightToLeft
;
window
[
'
Asc
'
][
'
c_oAscSparklineColors
'
]
=
window
[
'
Asc
'
].
c_oAscSparklineColors
=
c_oAscSparklineColors
;
prot
=
c_oAscSparklineColors
;
prot
[
'
Series
'
]
=
prot
.
Series
;
prot
[
'
Negative
'
]
=
prot
.
Negative
;
prot
[
'
Axis
'
]
=
prot
.
Axis
;
prot
[
'
Markers
'
]
=
prot
.
Markers
;
prot
[
'
First
'
]
=
prot
.
First
;
prot
[
'
Last
'
]
=
prot
.
Last
;
prot
[
'
High
'
]
=
prot
.
High
;
prot
[
'
Low
'
]
=
prot
.
Low
;
})(
window
);
cell/model/UndoRedo.js
View file @
f753351a
...
...
@@ -443,6 +443,9 @@ var UndoRedoDataTypes = new function() {
this
.
DynamicFilter
=
75
;
this
.
Top10
=
76
;
this
.
PropertyChanges
=
79
;
this
.
SparklineProps
=
80
;
this
.
Create
=
function
(
nType
)
{
switch
(
nType
)
...
...
cell/model/Workbook.js
View file @
f753351a
...
...
@@ -5696,7 +5696,7 @@ Woorksheet.prototype.updateSparklineCache = function(sheet, ranges) {
Woorksheet
.
prototype
.
getSparklineGroup
=
function
(
c
,
r
)
{
for
(
var
i
=
0
;
i
<
this
.
aSparklineGroups
.
length
;
++
i
)
{
if
(
-
1
!==
this
.
aSparklineGroups
[
i
].
contains
(
c
,
r
))
{
return
this
.
aSparklineGroups
[
i
];
return
this
.
aSparklineGroups
[
i
]
.
clone
(
true
)
;
}
}
return
null
;
...
...
cell/model/WorkbookElems.js
View file @
f753351a
...
...
@@ -4579,14 +4579,76 @@ CellArea.prototype = {
}
};
/** @constructor */
function
propertyChanges
()
{
this
.
propertyObj
=
{};
}
propertyChanges
.
prototype
.
getType
=
function
()
{
return
AscCommonExcel
.
UndoRedoDataTypes
.
PropertyChanges
;
};
propertyChanges
.
prototype
.
getProperties
=
function
()
{
var
res
=
{};
for
(
var
i
in
this
.
propertyObj
)
{
res
[
i
]
=
i
;
}
return
res
;
};
propertyChanges
.
prototype
.
getProperty
=
function
(
nType
)
{
return
this
.
propertyObj
[
nType
];
};
propertyChanges
.
prototype
.
setProperty
=
function
(
nType
,
value
)
{
this
.
propertyObj
[
nType
]
=
value
;
};
/** @constructor */
function
sparklineChanges
()
{
this
.
Properties
=
{
attributes
:
0
,
colors
:
1
};
this
.
attributes
=
new
propertyChanges
();
this
.
colors
=
new
propertyChanges
();
}
sparklineChanges
.
prototype
.
getType
=
function
()
{
return
AscCommonExcel
.
UndoRedoDataTypes
.
SparklineProps
;
};
sparklineChanges
.
prototype
.
getProperties
=
function
()
{
return
this
.
Properties
;
};
sparklineChanges
.
prototype
.
getProperty
=
function
(
nType
)
{
switch
(
nType
)
{
case
this
.
Properties
.
attributes
:
return
this
.
attributes
;
break
;
case
this
.
Properties
.
colors
:
return
this
.
colors
;
break
;
}
return
null
;
};
sparklineChanges
.
prototype
.
setProperty
=
function
(
nType
,
value
)
{
switch
(
nType
)
{
case
this
.
Properties
.
attributes
:
this
.
attributes
=
value
;
break
;
case
this
.
Properties
.
colors
:
this
.
colors
=
value
;
break
;
}
};
sparklineChanges
.
prototype
.
setAttribute
=
function
(
type
,
value
)
{
this
.
attributes
.
setProperty
(
type
,
value
);
};
sparklineChanges
.
prototype
.
setColor
=
function
(
type
,
value
)
{
this
.
colors
.
setProperty
(
type
,
value
);
};
/** @constructor */
function
sparklineGroup
()
{
// attributes
this
.
manualMax
=
undefined
;
this
.
manualMin
=
undefined
;
this
.
lineWeight
=
0.75
;
this
.
type
=
Asc
.
c_oAscSparklineType
.
Line
;
this
.
dateAxis
=
false
;
this
.
lineWeight
=
0.75
;
this
.
displayEmptyCellsAs
=
Asc
.
c_oAscEDispBlanksAs
.
Zero
;
this
.
markers
=
false
;
this
.
high
=
false
;
...
...
@@ -4600,6 +4662,10 @@ CellArea.prototype = {
this
.
maxAxisType
=
Asc
.
c_oAscSparklineAxisMinMax
.
Individual
;
this
.
rightToLeft
=
false
;
this
.
manualMax
=
undefined
;
this
.
manualMin
=
undefined
;
this
.
dateAxis
=
false
;
// elements
this
.
colorSeries
=
null
;
this
.
colorNegative
=
null
;
...
...
@@ -4609,6 +4675,7 @@ CellArea.prototype = {
this
.
colorLast
=
null
;
this
.
colorHigh
=
null
;
this
.
colorLow
=
null
;
this
.
f
=
null
;
this
.
arrSparklines
=
[];
this
.
arrCachedSparklines
=
[];
...
...
@@ -4616,6 +4683,9 @@ CellArea.prototype = {
//for drawing preview
this
.
canvas
=
null
;
this
.
sparklineView
=
null
;
// for changes
this
.
sparklineChanges
=
null
;
}
sparklineGroup
.
prototype
.
clone
=
function
(
onlyProps
)
{
...
...
@@ -4692,6 +4762,20 @@ CellArea.prototype = {
}
return
-
1
;
};
sparklineGroup
.
prototype
.
asc_setAttribute
=
function
(
type
,
value
)
{
if
(
!
this
.
sparklineChanges
)
{
this
.
sparklineChanges
=
new
sparklineChanges
();
}
this
.
sparklineChanges
.
setAttribute
(
type
,
value
);
};
sparklineGroup
.
prototype
.
asc_setColor
=
function
(
type
,
value
)
{
if
(
!
this
.
sparklineChanges
)
{
this
.
sparklineChanges
=
new
sparklineChanges
();
}
this
.
sparklineChanges
.
setColor
(
type
,
value
);
};
sparklineGroup
.
prototype
.
asc_getType
=
function
()
{
return
this
.
type
;
};
...
...
@@ -4890,20 +4974,19 @@ CellArea.prototype = {
return
aRet
;
};
sparklineGroup
.
prototype
.
asc_setStyle
=
function
(
nStyleIndex
){
var
oStyle
=
AscFormat
.
aSparklinesStyles
[
nStyleIndex
];
if
(
oStyle
)
{
this
.
colorSeries
=
this
.
createExcellColor
(
oStyle
[
0
]);
this
.
colorNegative
=
this
.
createExcellColor
(
oStyle
[
1
]);
this
.
colorAxis
=
this
.
createExcellColor
(
0xff000000
);
this
.
colorMarkers
=
this
.
createExcellColor
(
oStyle
[
2
]);
this
.
colorFirst
=
this
.
createExcellColor
(
oStyle
[
3
]);
this
.
colorLast
=
this
.
createExcellColor
(
oStyle
[
4
]);
this
.
colorHigh
=
this
.
createExcellColor
(
oStyle
[
5
]);
this
.
colorLow
=
this
.
createExcellColor
(
oStyle
[
6
]);
}
};
sparklineGroup
.
prototype
.
asc_setStyle
=
function
(
nStyleIndex
)
{
var
oStyle
=
AscFormat
.
aSparklinesStyles
[
nStyleIndex
];
if
(
oStyle
)
{
this
.
colorSeries
=
this
.
createExcellColor
(
oStyle
[
0
]);
this
.
colorNegative
=
this
.
createExcellColor
(
oStyle
[
1
]);
this
.
colorAxis
=
this
.
createExcellColor
(
0xff000000
);
this
.
colorMarkers
=
this
.
createExcellColor
(
oStyle
[
2
]);
this
.
colorFirst
=
this
.
createExcellColor
(
oStyle
[
3
]);
this
.
colorLast
=
this
.
createExcellColor
(
oStyle
[
4
]);
this
.
colorHigh
=
this
.
createExcellColor
(
oStyle
[
5
]);
this
.
colorLow
=
this
.
createExcellColor
(
oStyle
[
6
]);
}
};
/** @constructor */
function
sparkline
()
{
this
.
sqref
=
null
;
...
...
@@ -7102,8 +7185,11 @@ function getCurrencyFormat(opt_cultureInfo, opt_fraction, opt_currency, opt_curr
window
[
'
AscCommonExcel
'
].
RangeDataManagerElem
=
RangeDataManagerElem
;
window
[
'
AscCommonExcel
'
].
RangeDataManager
=
RangeDataManager
;
window
[
'
AscCommonExcel
'
].
CellArea
=
CellArea
;
window
[
"
AscCommonExcel
"
].
sparklineChanges
=
sparklineChanges
;
window
[
'
AscCommonExcel
'
].
sparklineGroup
=
sparklineGroup
;
prot
=
sparklineGroup
.
prototype
;
prot
[
"
asc_setAttribute
"
]
=
prot
.
asc_setAttribute
;
prot
[
"
asc_setColor
"
]
=
prot
.
asc_setColor
;
prot
[
"
asc_getType
"
]
=
prot
.
asc_getType
;
prot
[
"
asc_getLineWeight
"
]
=
prot
.
asc_getLineWeight
;
prot
[
"
asc_getDisplayEmpty
"
]
=
prot
.
asc_getDisplayEmpty
;
...
...
@@ -7145,7 +7231,7 @@ function getCurrencyFormat(opt_cultureInfo, opt_fraction, opt_currency, opt_curr
window
[
'
AscCommonExcel
'
].
getShortDateFormat
=
getShortDateFormat
;
window
[
'
AscCommonExcel
'
].
getCurrencyFormatSimple
=
getCurrencyFormatSimple
;
window
[
'
AscCommonExcel
'
].
getCurrencyFormat
=
getCurrencyFormat
;
window
[
"
Asc
"
][
"
CustomFilters
"
]
=
window
[
"
Asc
"
].
CustomFilters
=
CustomFilters
;
prot
=
CustomFilters
.
prototype
;
prot
[
"
asc_getAnd
"
]
=
prot
.
asc_getAnd
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment