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

do not show duplicate images #3

Open
7yl4r opened this issue Dec 19, 2018 · 1 comment
Open

do not show duplicate images #3

7yl4r opened this issue Dec 19, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@7yl4r
Copy link
Member

7yl4r commented Dec 19, 2018

Setting a time delta of higher granularity than the source data will result in duplicated images.
That ok, but even better might be to replace the duplicates with a placeholder image.

I just created a placeholder image ellipsis.png and stuck a TODO in the function where this test ought to go.

The trouble is that comparing the content of two images w/ different URLs is not easy.
Just another enhancement that is very doable but not worth the time until someone asks for it.

@7yl4r 7yl4r added the enhancement New feature or request label Dec 19, 2018
7yl4r added a commit that referenced this issue Dec 19, 2018
@7yl4r
Copy link
Member Author

7yl4r commented Jan 28, 2019

This is kind-of fixed because angular throws errors on duplicate images inside the ng-repeat.
I introduced this accidentally, but I think it is an accidental "feature".

Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: url in ctrl.panel.urls track by url.request_time, Duplicate key: Thursday, Dec 27th, Duplicate value: {"display":"http://imars-physalis.marine.usf.edu:8080/erddap/griddap/jplMURSST41anom1day.png?sstAnom[(2018-12-27T22:28:00Z)][(23.5):(26)][(-84):(-79.5)]&.draw=surface&.vars=longitude%7Clatitude%7CsstAnom&.colorBar=%7C%7C%7C%7C%7C&.bgColor=0xffccccff&.trim=1&.legend=Bottom&.size=16800%7C","link":"http://imars-physalis.marine.usf.edu:8080/erddap/griddap/jplMURSST41anom1day.largePng?sstAnom[(2018-12-27T22:28:00Z)][(23.5):(26)][(-84):(-79.5)]&.draw=surface&.vars=longitude%7Clatitude%7CsstAnom&.colorBar=%7C%7C%7C%7C%7C&.bgColor=0xffccccff&.trim=1&.legend=Bottom&.size=%7C","request_time":"Thursday, Dec 27th"}
http://errors.angularjs.org/1.6.6/ngRepeat/dupes?p0=url%20in%20ctrl.panel.urls%20track%20by%20url.request_time&p1=Thursday%2C%20Dec%2027th&p2=%7B%22display%22%3A%22http%3A%2F%2Fimars-physalis.marine.usf.edu%3A8080%2Ferddap%2Fgriddap%2FjplMURSST41anom1day.png%3FsstAnom%5B(2018-12-27T22%3A28%3A00Z)%5D%5B(23.5)%3A(26)%5D%5B(-84)%3A(-79.5)%5D%26.draw%3Dsurface%26.vars%3Dlongitude%257Clatitude%257CsstAnom%26.colorBar%3D%257C%257C%257C%257C%257C%26.bgColor%3D0xffccccff%26.trim%3D1%26.legend%3DBottom%26.size%3D16800%257C%22%2C%22link%22%3A%22http%3A%2F%2Fimars-physalis.marine.usf.edu%3A8080%2Ferddap%2Fgriddap%2FjplMURSST41anom1day.largePng%3FsstAnom%5B(2018-12-27T22%3A28%3A00Z)%5D%5B(23.5)%3A(26)%5D%5B(-84)%3A(-79.5)%5D%26.draw%3Dsurface%26.vars%3Dlongitude%257Clatitude%257CsstAnom%26.colorBar%3D%257C%257C%257C%257C%257C%26.bgColor%3D0xffccccff%26.trim%3D1%26.legend%3DBottom%26.size%3D%257C%22%2C%22request_time%22%3A%22Thursday%2C%20Dec%2027th%22%7D

I keep thinking something like the following is going to fix this, but the data isn't on the client-side until the actual image data comes back out. I am pretty baffled as to how angular is identifying the duplicates since display and link urls and request_time are unique.

            if (this.panel.urls.includes(this_url)){
                console.log('dup')
            } else {
                this.panel.urls.push(this_url)
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant