Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit303c112

Browse files
authored
Merge pull request#257 from Minku-Koo/devops
Fixed#256 : [BUG] Scrolling Issue with iloc in Subset App
2 parentsfca3d9b +e7565a1 commit303c112

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

‎visualpython/js/com/com_Kernel.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,14 @@ define([
610610
*@param {*} dataframe
611611
*@returns
612612
*/
613-
getRowList(dataframe){
613+
getRowList(dataframe,start_idx){
614614
varthat=this;
615+
if(typeofstart_idx==='undefined'){
616+
start_idx=0;
617+
}
618+
615619
returnnewPromise(function(resolve,reject){
616-
that.execute(com_util.formatString('_vp_print(_vp_get_rows_list({0}))',dataframe))
620+
that.execute(com_util.formatString('_vp_print(_vp_get_rows_list({0}, {1}))',dataframe,start_idx))
617621
.then(function(resultObj){
618622
resolve(resultObj);
619623
}).catch(function(err){

‎visualpython/js/m_apps/Subset.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,13 @@ define([
343343
$(this.wrapSelector('.select-row .vp-ds-select-box.left')).on('scroll',function(){
344344
if($(this).scrollTop()+$(this).innerHeight()>=($(this)[0].scrollHeight-2)){
345345
letscrollPos=$(this).scrollTop();
346+
if(that.state.rowLimit>that.state.rowList.length){
347+
return;// Prevents scroll from being fixed downwards
348+
}
346349
letstart=that.state.rowLimit;
347350
letend=start+10;
348351
letsubsetVariable=com_util.formatString('{0}.iloc[{1}:{2}]',that.state.pandasObject,start,end);
349-
vpKernel.getRowList(subsetVariable).then(function(resultObj){
352+
vpKernel.getRowList(subsetVariable,start).then(function(resultObj){
350353
let{ result}=resultObj;
351354
var{list:rowList}=JSON.parse(result);
352355
rowList=rowList.map(function(x){
@@ -361,9 +364,9 @@ define([
361364
rowList=rowList.map(function(x){
362365
return{
363366
...x,
364-
label:x.location+'',
365-
value:x.location+'',
366-
code:x.location+'',
367+
label:x.label+'',
368+
value:x.value+'',
369+
code:x.code+'',
367370
};
368371
});
369372
}

‎visualpython/python/pandasCommand.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
# from IPython.core.display is deprecated since IPython 7.14
1212
fromIPython.displayimportdisplay
1313

14-
def_vp_get_rows_list(df):
14+
def_vp_get_rows_list(df,start_idx=0):
1515
"""
1616
Get Rows List with Detail Information
1717
"""
1818
rowInfo= {'name':df.index.name,'level':df.index.nlevels,'list': [] }
1919
indexType=str(df.index.dtype)
2020
# make dict for rows info
2121
fori,rinenumerate(df.index):
22-
rInfo= {'label':r,'value':r,'location':i }
22+
rInfo= {'label':r,'value':r,'location':start_idx+i }
23+
2324
# value
2425
iftype(r).__name__=='str':
2526
rInfo['value']="'{}'".format(r)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp