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

inconsistent behavior of OutDegreeRangeBuilder, InDegreeRangeBuilder, DegreeRangeBuilder #2661

Closed
j-hap opened this issue Oct 15, 2022 · 2 comments

Comments

@j-hap
Copy link

j-hap commented Oct 15, 2022

Neither a bug, nor a feature request, more an improvement. I will maybe do a PR myself, but gotta get than assignment done first...

Expected Behavior

all *DegreeRangeBuilders should return corresponding types, when getFilter() is called.

Current Behavior

The OutDegreeRangeBuilder returns a generic Object of interface type Filter, InDegreeRangeBuilder and DegreeRangeBuilder return the specialized internal object InDegreeRangeFilter and DegreeRangeFilter respectively.

Possible Solution

all three should probably return a RangeFilter and the setRange() method should be declared in that interface and overwritten in DegreeRangeFilter, InDegreeRangeFilter and OutDegreeRangeFilter

Steps to Reproduce

var f1 = new OutDegreeRangeBuilder.getFilter() // returns a Filter
var f2 = new InDegreeRangeBuilder.getFilter() // returns a InDegreeRangeFilter
var f3 = new DegreeRangeBuilder.getFilter() // returns a DegreeRangeFilter

Context

when using the gephi-toolkit with there filters, one has to cast the result of OutDegreeRangeFilter.getFilter() to set the range.

Your Environment

  • Version used: Gephi 0.9.7
  • Operating System: Win 10 21H2
  • Java 11
@mbastian
Copy link
Member

Good catch. Let me know if you need any help with the PR!

@mbastian mbastian added this to the 0.10.0 milestone Oct 21, 2022
@mbastian
Copy link
Member

Thanks I fixed this one. The reason we don't expose setRange int he RangeFilter interface I think is to avoid direct edition of the range value. The correct way is to pass through the FilterProperty normally. I don't think it matters for Toolkit users though but int he Gephi UI, if you would use setRange directly the UI wouldn't update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants