I found a clustering sample in ArcGis website. Points clustering
However in the sample is passing in JSON data to the cluster layer in order to perform the clustering. Is there any method to do similar action but the source will be from a stream layer instead of a JSON data or feature layer?