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
1e57bb98
Commit
1e57bb98
authored
May 12, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rebuild sparklines cache after change cell value
parent
42bb3891
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
14 deletions
+34
-14
cell/model/Serialize.js
cell/model/Serialize.js
+1
-1
cell/model/Workbook.js
cell/model/Workbook.js
+13
-0
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+18
-6
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+2
-0
common/Charts/DrawingObjects.js
common/Charts/DrawingObjects.js
+0
-7
No files found.
cell/model/Serialize.js
View file @
1e57bb98
...
...
@@ -6629,7 +6629,7 @@
this
.
ReadSparkline
=
function
(
type
,
length
,
oSparkline
)
{
var
res
=
c_oSerConstants
.
ReadOk
;
if
(
c_oSer_Sparkline
.
SparklineRef
===
type
)
{
oSparkline
.
f
=
this
.
stream
.
GetString2LE
(
length
);
oSparkline
.
setF
(
this
.
stream
.
GetString2LE
(
length
)
);
}
else
if
(
c_oSer_Sparkline
.
SparklineSqRef
===
type
)
{
oSparkline
.
setSqref
(
this
.
stream
.
GetString2LE
(
length
));
}
else
...
...
cell/model/Workbook.js
View file @
1e57bb98
...
...
@@ -3151,6 +3151,11 @@ Workbook.prototype.getTableNameColumnByIndex = function(tableName, columnIndex){
}
return
res
;
};
Workbook
.
prototype
.
updateSparklineCache
=
function
(
sheet
,
ranges
)
{
for
(
var
i
=
0
;
i
<
this
.
aWorksheets
.
length
;
++
i
)
{
this
.
aWorksheets
[
i
].
updateSparklineCache
(
sheet
,
ranges
);
}
};
//-------------------------------------------------------------------------------------------------
/**
* @constructor
...
...
@@ -5368,6 +5373,14 @@ Woorksheet.prototype.createTablePart = function(){
return
new
AscCommonExcel
.
TablePart
(
this
.
handlers
);
};
Woorksheet
.
prototype
.
onUpdateRanges
=
function
(
ranges
)
{
this
.
workbook
.
updateSparklineCache
(
this
.
sName
,
ranges
);
};
Woorksheet
.
prototype
.
updateSparklineCache
=
function
(
sheet
,
ranges
)
{
for
(
var
i
=
0
;
i
<
this
.
sparklineGroups
.
arrSparklineGroup
.
length
;
++
i
)
{
this
.
sparklineGroups
.
arrSparklineGroup
[
i
].
updateCache
(
sheet
,
ranges
);
}
};
//-------------------------------------------------------------------------------------------------
/**
* @constructor
...
...
cell/model/WorkbookElems.js
View file @
1e57bb98
...
...
@@ -4457,9 +4457,6 @@ function sparklineGroup() {
this
.
arrSparklines
=
[];
this
.
arrCachedSparklines
=
[];
}
sparklineGroup
.
prototype
.
clearCached
=
function
()
{
this
.
arrCachedSparklines
.
length
=
0
;
};
sparklineGroup
.
prototype
.
addView
=
function
(
oSparklineView
,
index
)
{
this
.
arrCachedSparklines
[
index
]
=
oSparklineView
;
};
...
...
@@ -4472,10 +4469,15 @@ sparklineGroup.prototype.draw = function(oDrawingContext) {
this
.
arrCachedSparklines
[
i
].
draw
(
graphics
);
}
};
sparklineGroup
.
prototype
.
updateCache
=
function
(
range
)
{
sparklineGroup
.
prototype
.
updateCache
=
function
(
sheet
,
ranges
)
{
for
(
var
i
=
0
;
i
<
this
.
arrSparklines
.
length
;
++
i
)
{
if
(
range
.
intersectionSimple
(
this
.
arrSparklines
[
i
].
f
))
{
this
.
arrCachedSparklines
[
i
]
=
null
;
if
(
sheet
===
this
.
arrSparklines
[
i
].
fSheet
)
{
for
(
var
j
=
0
;
j
<
ranges
.
length
;
++
j
)
{
if
(
ranges
[
j
].
intersectionSimple
(
this
.
arrSparklines
[
i
].
fRange
))
{
this
.
arrCachedSparklines
[
i
]
=
null
;
break
;
}
}
}
}
};
...
...
@@ -4483,10 +4485,20 @@ sparklineGroup.prototype.updateCache = function(range) {
function
sparkline
()
{
this
.
sqref
=
null
;
this
.
f
=
null
;
this
.
fRange
=
null
;
this
.
fSheet
=
null
;
}
sparkline
.
prototype
.
setSqref
=
function
(
sqref
)
{
this
.
sqref
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
sqref
);
};
sparkline
.
prototype
.
setF
=
function
(
f
)
{
this
.
f
=
f
;
var
res
=
parserHelp
.
parse3DRef
(
this
.
f
);
if
(
res
)
{
this
.
fSheet
=
res
.
sheet
;
this
.
fRange
=
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
res
.
range
);
}
};
sparkline
.
prototype
.
checkInRange
=
function
(
range
)
{
return
this
.
sqref
?
range
.
isIntersect
(
this
.
sqref
)
:
false
;
};
...
...
cell/view/WorksheetView.js
View file @
1e57bb98
...
...
@@ -11726,6 +11726,8 @@
this
.
_updateSelectionNameAndInfo
();
}
this
.
model
.
onUpdateRanges
(
arrChanged
);
this
.
objectRender
.
rebuildChartGraphicObjects
(
new
AscFormat
.
CChangeTableData
(
null
,
null
,
null
,
null
,
arrChanged
)
);
this
.
cellCommentator
.
updateCommentPosition
();
this
.
handlers
.
trigger
(
"
onDocumentPlaceChanged
"
);
...
...
common/Charts/DrawingObjects.js
View file @
1e57bb98
...
...
@@ -2348,13 +2348,6 @@ function DrawingObjects() {
}
};
_this
.
clearSparklineGroups
=
function
(
oSparklineGroups
,
range
)
{
for
(
var
i
=
0
;
i
<
oSparklineGroups
.
arrSparklineGroup
.
length
;
++
i
)
{
var
oSparklineGroup
=
oSparklineGroups
.
arrSparklineGroup
[
i
];
oSparklineGroup
.
updateCache
(
range
);
}
};
_this
.
checkSparklineGroupMinMaxVal
=
function
(
oSparklineGroup
)
{
var
maxVal
=
null
,
minVal
=
null
,
i
,
j
;
...
...
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