i dont find any examples related to the 4.x version yet there are many for the 3.x versions can anbody help me out?
The 4.x api does not have all the features and classes that the 3.x api has YET. Clustering in the 3.x api was a custom layer (not part of the API). There is no clustering support yet.
so can we use that custom layer to develop with 4.x?
I am not sure. It likely would have to be updated.
thank you robert, do you have any idea how to create table of contents in 4.x?
Have you not seen the LayerList widget?
yes i have seen it but with the layers symbols too...the symbols are not displaying so i want to create the table of contents which shows the symbols of each layer
That ability is not available yet.
By the way, do esri have the plan to including cluster layer class in the js api in the near future ?
Sorry I do not know that.
Looks like this GitHub repo might have what you need:
supports both 3.x and 4.x
Here are the samples in the documentation for 3.x that show clustering.
Take particular not of the setFeatureReduction() method on the FeatureLayer.
Retrieving data ...